ferron

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

commit 73ba21f62047849e3f857df8c7b25a0a0da0ef91
parent 4094c300e49a548876d7bdd1a74cab30476c9279
Author: Hugo Soucy <hs0ucy@h50ucy.local>
Date:   Fri, 28 Jun 2019 23:53:27 -0400

Optimize things

Diffstat:
Mferron/init.lua | 7+------
Mferron/site.lua | 6+++---
Mferron/utilities/table-utils.lua | 7+++++++
3 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/ferron/init.lua b/ferron/init.lua @@ -35,13 +35,8 @@ Ferron = { if arg[1] == 'build' then do local sitename = arg[3] - local function build(funcTable) - for i, func in ipairs(funcTable) do - return func - end - end - return build{ + return tableutils.build{ site.setsite(sitename), site.setnavigation(), page.makepages(), diff --git a/ferron/site.lua b/ferron/site.lua @@ -103,12 +103,12 @@ function site.setsite(sitename) site.setsitepath(thatsite) site.setsiteconfig(thatsite) - -- 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 absolute path properties for the chosen site's folders site.makepaths(site.setsitepath(thatsite), site.setsiteconfig(thatsite)) + -- Have different values if devmode is at true or not + site.config.baseurl = (Ferron.devmode == true and site.config.urldev or site.config.url) + return end diff --git a/ferron/utilities/table-utils.lua b/ferron/utilities/table-utils.lua @@ -123,4 +123,11 @@ function tableutils.filter(func, tbl) return _tbl end +-- build +function tableutils.build(funcTable) + for i, func in ipairs(funcTable) do + return func + end +end + return setmetatable(tableutils, tableutilsmeta)