satelito

Static [web] site (or page) generator (ssg) made with Lua script.
git clone git://soucy.cc/satelito.git
Log | Files | Refs | README

commit a918adf47fbeef9b203c3f145e531a1fa10dc39f
parent 0e117fab4c07eab10fd62be1741d1f5da4e23ad3
Author: Hugo Soucy <hugo@soucy.cc>
Date:   Tue,  8 Feb 2022 09:36:14 -0500

Try to loop the partial meta

Diffstat:
Msatelito/page.lua | 10+++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/satelito/page.lua b/satelito/page.lua @@ -5,13 +5,13 @@ local etlua = require 'etlua' local lume = require 'satelito.lib.lume.lume' local file = require 'satelito.file' local template = require 'satelito.template' +local inspect = require 'inspect' --- Build a page from markdown/lua to HTML -- @name page.build -- @param filepath a pathname to a markdown file -- @return a string that is an HTML code block -- @return a string that is a filepath - function page.make(filemeta, templates) local head = etlua.compile(file.read(template.find(templates, filemeta.head))) local navigation = etlua.compile(file.read(template.find(templates, filemeta.navigation))) @@ -19,6 +19,14 @@ function page.make(filemeta, templates) local footer = etlua.compile(file.read(template.find(templates, filemeta.footer))) local layout = etlua.compile(file.read(template.find(templates, filemeta.layout))) + if type(filemeta.partial) == 'table' then + for k, v in pairs(filemeta.partial) do + _G['partial_'..k] = etlua.compile(file.read(template.find(templates, filemeta.partial[k]))) + + print(inspect(_G['partial_'..k])) + end + end + -- Then put them all together local html = layout( lume.extend({},