commit aba2a6d0180049314a4d8179e07a979818a856f1
parent 58ec93a162331635271206247bd3130207b55f1b
Author: Hugo Soucy <hugo@soucy.cc>
Date: Sun, 13 Mar 2022 10:56:07 -0400
Sort by desc already and remove extend methods
Diffstat:
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/satelito/init.lua b/satelito/init.lua
@@ -110,7 +110,7 @@ if args['pipe'] then
print('=> Fetching the markdown and HTML content ...')
end
- sitemap[#sitemap+1] = lume.extend({}, meta)
+ sitemap[#sitemap+1] = meta
end
end
end
@@ -122,9 +122,13 @@ if args['pipe'] then
templates = lume.array(dirtree.get(lfs.currentdir() .. '/' .. config.paths.templates))
print('=> Making the web site ...')
+
+ table.sort(sitemap, function(a, b) return a.idorder > b.idorder end)
+
return site.make(sitemap, templates, args['export'], timestart, config)
end
+-- Make command
-- Example: '$ satelito make --export'
if args['make'] then
local config
@@ -151,7 +155,7 @@ if args['make'] then
if file.is_markdown(filepath) or file.is_html(filepath) then
local meta = model.set(filepath, config, contentdir)
- sitemap[#sitemap+1] = lume.extend({}, meta)
+ sitemap[#sitemap+1] = meta
end
end
@@ -168,6 +172,9 @@ if args['make'] then
end
print('=> Making the web site ...')
+
+ table.sort(sitemap, function(a, b) return a.idorder > b.idorder end)
+
return site.make(sitemap, templates, args['export'], timestart, config)
else
print('There is no "config.lua" here.')