added template.render function

This commit is contained in:
gabryon99 2021-03-05 11:47:59 +01:00
parent fc3d065180
commit 30bf1e5589
2 changed files with 13 additions and 2 deletions

View file

@ -43,4 +43,12 @@ function template.gen(template_file, context, is_full_path)
return template.compile(path, nil, nil)(context)
end
---Print the template inside the requested page
---@param template_file string The template file to render
---@param context table The data used by the page template
---@param is_full_path boolean Is an absolute path?
function template.render(template_file, context, is_full_path)
print(template.gen(template_file, context, is_full_path))
end
return template