ferron

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

commit e51c2647f6e0e193e1c71ca0a8e9541d0108e3eb
parent cdeab89d47ffe848254666cb36c171018d328947
Author: Hugo Soucy <hugo@soucy.cc>
Date:   Sun, 26 Apr 2020 21:50:52 -0400

Add a get template file function

Diffstat:
Mferron/utilities/file-utils.lua | 8++++++++
1 file changed, 8 insertions(+), 0 deletions(-)

diff --git a/ferron/utilities/file-utils.lua b/ferron/utilities/file-utils.lua @@ -260,6 +260,14 @@ function fileutils.getpageconf(pagepath) return pageconf end +-- get template file +function fileutils.gettemplatefile(pagepath, sitedata) + local dir = lfs.currentdir() .. '/' .. sitedata.templates + local name = (fileutils.getpageconf(pagepath).template or 'default') + + return dir .. '/' .. name .. '.mustache' +end + function fileutils.shorturlencode(num) local alphabet = '23456789bcdfghjkmnpqrstvwxyzBCDFGHJKLMNPQRSTVWXYZ_' local base = alphabet:len()