commit 3eb57e4de0ae1e3126aa83f6e22366fc63c923af
parent 5567d813acb136ad90628f9c3f02f595b1f9e530
Author: Hugo Soucy <hsoucy@kronostechnologies.com>
Date: Wed, 12 Sep 2018 18:57:11 -0400
Optimize a `path.each` argument.
Diffstat:
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/ferron/list.lua b/ferron/list.lua
@@ -61,9 +61,9 @@ function list.makelist()
local templatespath = Ferron.site.path .. Ferron.site.siteconfig.paths.templates
path.each(
- contentpath .. "/*.md",
+ contentpath .. "/index.md",
function(list)
- if path.basename(list) == "index.md" and list ~= contentpath .. "/index.md" then
+ if list ~= contentpath .. "/index.md" then
local list_htmlpath = fileutils.sethtmlpath(fileutils.getrelpath(path.dirname(list)))
local list_conf = json.decode(fileutils.pullfilecontent(fileutils.removeextension(list) .. ".json"))
local list_conf_mt = setmetatable({}, { __index = list_conf })
@@ -109,9 +109,9 @@ function list.makelist()
list_conf["site"] = nil
fileutils.pushfilecontent(
- fileutils.removeextension(list) .. ".json",
- json.encode(list_conf, {indent = true, keyorder = {"bridgy","cite","citeurl","content","date","datetime","description","id","keywords","permalink","template","title","updated"}})
- )
+ fileutils.removeextension(list) .. ".json",
+ json.encode(list_conf, {indent = true, keyorder = {"bridgy","cite","citeurl","content","date","datetime","description","id","keywords","permalink","template","title","updated"}})
+ )
end
end,
{