ferron

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

commit 9b7142ea43d1acf1c6033d9f20ecf143b9870790
parent d2b7202ae2385ec313c6d774a3b1fba5fc1341e1
Author: Hugo Soucy <hsoucy@kronostechnologies.com>
Date:   Tue, 11 Sep 2018 09:10:27 -0400

Optimize `site.getsiteinfos` function

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

diff --git a/ferron/site.lua b/ferron/site.lua @@ -23,13 +23,10 @@ end function site.getsiteinfos(sitename) package.path = package.path .. ";sites/".. sitename .."/?.lua" - local site = Ferron.sites .. sitename local site_config = require "site-config" - local site_infos = {} - -- Create a table with the basic infos of the site - site_infos = { - path = site, + local site_infos = { + path = Ferron.sites .. sitename, siteconfig = site_config, pagestable = {}, } @@ -88,7 +85,7 @@ end function site.reset() -- Reset the `public_html/` folder of the selected site - fileutils.emptydirectory(Ferron.site.path .. Ferron.site.siteconfig.paths.html .. "/") + return fileutils.emptydirectory(Ferron.site.path .. Ferron.site.siteconfig.paths.html .. "/") end return site