ferron

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

commit da596deec7d05e2d536bcd7b40bb33551ac00afe
parent f0af90c2a17bf3a8d39dd7d3aa840d7f1eeb77a3
Author: Hugo Soucy <hugo.soucy@equisoft.com>
Date:   Wed, 28 Aug 2019 09:28:11 -0400

Merge branch 'master' of github.com:hs0ucy/Ferron

Diffstat:
Mferron/utilities/template-utils.lua | 20++++----------------
1 file changed, 4 insertions(+), 16 deletions(-)

diff --git a/ferron/utilities/template-utils.lua b/ferron/utilities/template-utils.lua @@ -7,7 +7,6 @@ local templateutilsmeta = { } local lustache = require 'lustache' -local etlua = require 'etlua' local fl = require 'ferron.utilities.file-utils' @@ -25,10 +24,8 @@ function templateutils.selecttemplate(index, templatename) template = templatepath .. 'default' end end - -- etlua or mustache - -- etlua templates will outrank the mustache ones - return assert(fl.isFile(template .. '.etlua') and template .. '.etlua' or template .. '.mustache', - 'You need to add some templates to your site.') + + return assert(template .. '.mustache', 'You need to add some templates to your site.') end -- process mustache @@ -44,22 +41,13 @@ function templateutils.rendermustache(tpl, partialspath, data) return lustache:render(tpl, data, partials) end --- process etlua -function templateutils.renderetlua(template, data) - local render = etlua.compile(template) - - return render(data) -end - -- process template function templateutils.rendertemplate(template, data, partials) local extension = fl.getextension(template) local render = nil - if extension == '.etlua' then - render = templateutils.renderetlua(fl.pullfilecontent(template), data) - elseif extension == '.mustache' then - render = templateutils.rendermustache(fl.pullfilecontent(template), partials, data) + if extension == '.mustache' then + render = templateutils.rendermustache(fl.pullfilecontent(template), partials, data) end return render