ferron

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

commit 82908f995cbee49a8119c18911727c700e9badfa
parent e302f0525cf20ebe89a643c1d1c4b0f4cd68c243
Author: Hugo Soucy <hsoucy@kronostechnologies.com>
Date:   Thu, 10 May 2018 16:55:40 -0400

Put the path to the template of a page in a var.

Diffstat:
Mferron/page.lua | 3++-
Msites/ferron-ssg.tld/content/index.json | 2+-
2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/ferron/page.lua b/ferron/page.lua @@ -27,6 +27,7 @@ function page.makepage() local page_conf = json.decode(fileutils.pullfilecontent(page_noextension .. ".json")) local page_conf_mt = setmetatable({}, { __index = page_conf }) local page_key = page_conf.date .. "|" .. page_conf.datetime .. "|" .. page_relpath + local page_template = Ferron.site.path .. Ferron.site.siteconfig.paths.templates .. "/" .. page_conf.template .. ".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 @@ -55,7 +56,7 @@ function page.makepage() fileutils.pushfilecontent( page_htmlpath .. "/" .. page_plainname .. ".html", templateutils.setmustache( - fileutils.pullfilecontent(Ferron.site.path .. Ferron.site.siteconfig.paths.templates .. "/" .. page_conf.template .. ".mustache"), + fileutils.pullfilecontent(page_template), Ferron.site.path .. Ferron.site.siteconfig.paths.templates .. "/partials", page_conf_mt ) diff --git a/sites/ferron-ssg.tld/content/index.json b/sites/ferron-ssg.tld/content/index.json @@ -4,5 +4,5 @@ "id":"tag:ferron-ssg.tld,0000-00-00:0000/00/index", "template":"default", "title":"Welcome to Ferron SSG", - "updated":"2018-02-02T14:11:15" + "updated":"2018-03-16T12:51:19" } \ No newline at end of file