ferron

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

commit 97769c9baaa269e98577056abb655198a1000078
parent 237fd9027395accb6180d8cec36382cc3feb6164
Author: Hugo Soucy <hugo.soucy@toumoro.com>
Date:   Mon, 10 Feb 2020 21:33:11 -0500

Removes unused parameters + adds current parameter in navigation

Diffstat:
Mferron/site.lua | 7++++---
1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/ferron/site.lua b/ferron/site.lua @@ -16,7 +16,7 @@ local function getsitelist() local location = config.sites return tb.map( - function(site, i) + function(site) if fl.isDirectory(location .. site) and fl.isNotDotDirectory(site) then @@ -95,7 +95,7 @@ end local function setnavigation(contentlocation, baseurl) local navigation = tb.map( - function(f, i) + function(f) local meta = fl.getpageconf(f) if meta.navigation then @@ -103,12 +103,13 @@ local function setnavigation(contentlocation, baseurl) local location = baseurl .. fl.removeextension(fl.getrelpath(f, contentlocation)) .. '.html' local attributes = meta.navigation.attributes local order = meta.navigation.order + local current = false if fl.getbasename(location) == 'index.html' then location = fl.getdirname(location) end - return {label = label, location = location, attributes = attributes, order = order} + return {label = label, location = location, attributes = attributes, order = order, current = current} end end, -- The data table