ferron

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

commit fdc517d136f7b3ed22aca1ddf1b934b4d7968d1e
parent d0fbcf8daf7620b9e86db92c1baba60defc4dd6c
Author: Hugo Soucy <hsoucy@kronostechnologies.com>
Date:   Thu,  1 Nov 2018 13:39:41 -0400

Make some test to the etlua function

Diffstat:
Mferron/utilities/template-utils.lua | 21++++++++++++++++++---
1 file changed, 18 insertions(+), 3 deletions(-)

diff --git a/ferron/utilities/template-utils.lua b/ferron/utilities/template-utils.lua @@ -39,11 +39,26 @@ function templateutils.rendermustache(tpl, partialspath, data) return lustache:render(tpl, data, partials) end --- +-- [[ +-- local etlua = require("etlua") + +-- local layout = [[ +-- <div> +-- <%= render_view() %> +-- </div> +-- ]] + +-- local view = [[ +-- <p>Hello, World!</p> +-- ]] + +-- etlua.render(layout, { render_view = etlua.compile(view) } +--]] function templateutils.renderetlua(template, data) - local render = etlua.compile(template) + -- local render = etlua.compile(template) + local render = etlua.render(template, {rendersub = etlua.compile(template)}) - return render(data) + return render end -- process template