satelito

Static [web] site (or page) generator (ssg) made with Lua script.
git clone git://soucy.cc/satelito.git
Log | Files | Refs | README

commit 66c25b889b12f316abcd741e1bfaa325fcd89f0a
parent 66a487bfd04e522a4766737678ba8b678b3a426a
Author: Hugo Soucy <hugo@soucy.cc>
Date:   Sun, 13 Mar 2022 10:57:49 -0400

Remove the sequence function

Diffstat:
Msatelito/site.lua | 32++++++--------------------------
1 file changed, 6 insertions(+), 26 deletions(-)

diff --git a/satelito/site.lua b/satelito/site.lua @@ -36,36 +36,16 @@ function site.make(sitemap, templates, export, timestart, config) local feed_xml, feed_xml_path local paginated + sitemap[i].index = i sitemap[i].children = list.get_children(sitemap[i].list, sitemap, sitemap[i].asc) sitemap[i].collection = list.get_collection(sitemap[i].collection, sitemap, sitemap[i].asc) - -- Get a sequence of pages for sequential navigation - sitemap[i].sequence = function(seqname) - if config.sequence[seqname] then - local _sequence = {} - local seq = list.get_collection(config.sequence[seqname].scope, sitemap, config.sequence[seqname].asc or false) - - if seq then - _sequence.length = #seq - _sequence.current = lume.find(seq, sitemap[i]) - - if _sequence.current > 1 then - _sequence.relprev = seq[(_sequence.current - 1)] - end - - if _sequence.current < _sequence.length then - _sequence.relnext = seq[(_sequence.current + 1)] - end - - if config.sequence[seqname].divider then - _sequence.relup = math.ceil(_sequence.current / config.sequence[seqname].divider) - end - - return _sequence - end - end + if i > 1 then + sitemap[i].relprev = sitemap[i-1] + end - return + if i < #sitemap then + sitemap[i].relnext = sitemap[i+1] end -- If a pagination is requested