on progresse

This commit is contained in:
Guy Godfroy 2020-12-03 22:07:38 +01:00
parent 7c5a7fe392
commit 25614b72e0
1 changed files with 8 additions and 2 deletions

View File

@ -123,10 +123,16 @@ for dirname, subdirlist, mdlist in os.walk('.'):
posts_meta.sort(key=lambda p: p["date"], reverse=True)
# Generate home page
with open(tpl_path+"/index.tpl", 'r') as tpl:
template = Template(tpl.read())
indextext = template.render(posts_meta=posts_meta)
with open(meta_path+"/index.gmi", 'w') as index:
index.write(indextext)
# Generate full list page
with open(tpl_path+"/posts_list.tpl", 'r') as tpl:
template = Template(tpl.read())
indextext = template.render(posts_meta=posts_meta)
with open(meta_path+"/posts/index.gmi", 'w') as index:
index.write(indextext)