commit 0fb96af803bbd88dd58139b272d40206ac081927
parent a830d08b9ca7b49e5763c92abce7b0a818963a2d
Author: Hugo Soucy <hugo@soucy.cc>
Date: Thu, 9 Aug 2018 20:00:13 -0400
Put the meta updated in the configuration metatable.
Diffstat:
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/ferron/page.lua b/ferron/page.lua
@@ -30,13 +30,13 @@ function page.makepage()
local page_key = page_conf.date .. "|" .. page_conf.datetime .. "|" .. page_relpath
local page_template = templatespath .. "/" .. (page_conf.template ~= nil and page_conf.template or "default") .. ".mustache"
- page_conf.updated = os.date("%Y-%m-%dT%H:%M:%S", path.mtime(page))
page_conf.id = "tag:" .. Ferron.site.siteconfig.domainname .. "," .. page_conf.date .. ":" .. string.sub(page_conf.date, 0, 4) .. "/" .. string.sub(page_conf.date, 6, 7) .. "/" .. page_plainname
-- Convert the markdown file to HTML
-- And put it in a metatable
page_conf_mt.content = markdown(fileutils.pullfilecontent(page))
+ page_conf_mt.updated = os.date("%Y-%m-%dT%H:%M:%S", path.mtime(page))
page_conf_mt.permalink = Ferron.site.siteconfig.baseurl .. (page_plainname ~= "index" and page_relpath .. ".html" or "")
page_conf_mt.rellink = (page_plainname ~= "index" and page_relpath .. ".html" or "")
page_conf_mt.section = nil
@@ -67,8 +67,10 @@ function page.makepage()
print(" !! " .. page_relpath .. ".html - error!")
end
+ page_conf.updated = nil
+
-- Update the JSON file data
- fileutils.pushfilecontent(page_noextension .. ".json", json.encode(page_conf, {indent = true, keyorder = {"bridgy","cite","citeurl","content","date","datetime","description","id","keywords","permalink","section","shortlink","template","title","updated"}}))
+ fileutils.pushfilecontent(page_noextension .. ".json", json.encode(page_conf, {indent = true, keyorder = {"bridgy","cite","citeurl","content","date","datetime","description","id","keywords","permalink","section","shortlink","template","title"}}))
end
end,
{