ferron

Ferron is a fast and simple static website generator made with Lua.
Log | Files | Refs | Submodules | README | LICENSE

commit 2eff271575b7faaba1c8e99a24a6f02f496f2816
parent 63f6b958a90c42d5b944bf6e808b9f434051ff63
Author: Hugo Soucy <hugo.soucy@equisoft.com>
Date:   Mon, 21 Oct 2019 19:59:28 -0400

Put all nodes in one table

Diffstat:
Mferron/page.lua | 5++---
Mferron/site.lua | 2++
2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/ferron/page.lua b/ferron/page.lua @@ -130,9 +130,8 @@ function page.render(page, sitedata) end function page.makepages(sitedata) - local contentpath = tb.from(fl.getdirtree(fl.isDirectory(sitedata.content))) - local singlepages = tb.filter(fl.isNotIndex, contentpath) - local indexpages = tb.filter(fl.isIndex, contentpath) + local singlepages = tb.filter(fl.isNotIndex, sitedata.nodes) + local indexpages = tb.filter(fl.isIndex, sitedata.nodes) -- Render single pages tb.each(function(p) page.render(p, sitedata) end, singlepages) diff --git a/ferron/site.lua b/ferron/site.lua @@ -151,6 +151,8 @@ function site.setsite(sitename) makepaths(setsitepath(thatsite), setsiteconfig(thatsite)), } + -- Store all site nodes in one table + site.nodes = tb.from(fl.getdirtree(fl.isDirectory(site.content))) -- Have different values if devmode is at true or not site.config.baseurl = (Ferron.devmode == true and site.config.urldev or site.config.url) -- Create the main navigation menu