fix date in template

This commit is contained in:
Guy Godfroy 2020-12-08 19:39:45 +01:00
parent 7698aabd44
commit defd77ece6
1 changed files with 1 additions and 0 deletions

View File

@ -157,6 +157,7 @@ for page_dict in config.custom_pages:
filepath = os.path.join(rel_path, filename) filepath = os.path.join(rel_path, filename)
with open(tpl_path + "/" + page_dict.get("tpl", basename) + ".tpl", "r") as tpl: with open(tpl_path + "/" + page_dict.get("tpl", basename) + ".tpl", "r") as tpl:
template = Template(tpl.read()) template = Template(tpl.read())
template.globals['now'] = datetime.now
text = template.render(posts=posts) text = template.render(posts=posts)
with open(gmi_path + "/" + filepath, "w") as gmi: with open(gmi_path + "/" + filepath, "w") as gmi:
gmi.write(text) gmi.write(text)