commit ee97eb8da6d9d3633d3e25852fa597161250e2cd
parent 60b64acb11f82b28b0d76da29493585ab6b17552
Author: Hugo Soucy <hugo@soucy.cc>
Date: Sun, 27 Feb 2022 13:30:00 -0500
Add an export path parameter
Diffstat:
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/satelito/page.lua b/satelito/page.lua
@@ -12,7 +12,9 @@ local template = require 'satelito.template'
-- @return a string that is an HTML code block
-- @return a string that is a filepath
-function page.make(filemeta, templates)
+function page.make(filemeta, templates, exportpath)
+ -- Compile different parts of the page
+ local navigation = etlua.compile(file.read(template.find(templates, filemeta.navigation)))
local head = etlua.compile(file.read(template.find(templates, filemeta.head)))
local navigation = etlua.compile(file.read(template.find(templates, filemeta.navigation)))
local post = etlua.compile(file.read(template.find(templates, filemeta.template)))
@@ -30,7 +32,7 @@ function page.make(filemeta, templates)
)
)
-- Get the target location of the page
- local html_path = filemeta.exportlink
+ local html_path = exportpath ~= nil and exportpath or filemeta.exportlink
return html, html_path
end