From 030b1c4cdb3baec6a28bf297a2e782961001159d Mon Sep 17 00:00:00 2001 From: Guy Godfroy Date: Thu, 3 Dec 2020 21:17:21 +0100 Subject: [PATCH] pass filename to template --- geminer.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/geminer.py b/geminer.py index 62c60a2..698feb6 100755 --- a/geminer.py +++ b/geminer.py @@ -61,13 +61,6 @@ for dirname, subdirlist, mdlist in os.walk('.'): # For now, tags list must be a comma-separated string # TODO: make possible to list tags as a YAML list - posts_meta.append({ - "title": title, - "author": author, - "date": date, - "tags": tags - }) - for item in config.replace: mdtext = mdtext.replace(item[0],item[1]) @@ -115,7 +108,16 @@ for dirname, subdirlist, mdlist in os.walk('.'): gmifile = basename if config.gmi_extension: gmifile += ".gmi" - print(gmi_subpath+"/"+gmifile) + + posts_meta.append({ + "title": title, + "author": author, + "date": date, + "tags": tags, + "filename": gmifile + }) + + print(gmi_subpath+"/"+gmifile) with open(gmi_subpath+"/"+gmifile, 'w') as gmi: gmi.write(gmitext)