satelito

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

commit f6ab45d2b18992b87271f97099c72001df57caa2
parent 5efed80ab889638f26c2d37d28f2113ef7ac21f5
Author: Hugo Soucy <hugo@soucy.cc>
Date:   Tue, 12 Oct 2021 20:28:13 -0400

Add single file into collection

Diffstat:
Msatelito/list.lua | 7+++++--
1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/satelito/list.lua b/satelito/list.lua @@ -38,8 +38,11 @@ function list.get_collection(collection, sitemap, asc) local contentdir = lfs.currentdir()..'/'..sitemap[1].paths.content for i = 1, #collection do - -- @TODO Tester si l'item est un fichier ou un répertoire - collection_list[#collection_list+1] = file.get_collection(contentdir..collection[i], contentdir) + if lfs.attributes(contentdir..collection[i]).mode == 'directory' then + collection_list[#collection_list+1] = file.get_collection(contentdir..collection[i], contentdir) + else + collection_list[#collection_list+1] = { collection[i] } + end end return list.get_children(lume.concat(table.unpack(collection_list)), sitemap, asc)