From 7b13fa794e3a6607c4c97c66b6d8a8899415ee27 Mon Sep 17 00:00:00 2001 From: Collin Lefeber Date: Sun, 16 Feb 2025 16:28:29 -0500 Subject: [PATCH] include unix ts template var for asset bust --- index.html.tmpl | 4 ++-- main.py | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/index.html.tmpl b/index.html.tmpl index a666006..8053e9e 100644 --- a/index.html.tmpl +++ b/index.html.tmpl @@ -5,8 +5,8 @@ cfebs.com${more_title} - - + +
diff --git a/main.py b/main.py index 4f3b6bb..723034a 100644 --- a/main.py +++ b/main.py @@ -92,6 +92,9 @@ def render_template(tpl_fname, out_fname, subs): with open(tpl_fname, "r", encoding="utf-8") as inf: tmpl = Template(inf.read()) + # include in every template + subs["_now"] = int(datetime.datetime.now().timestamp()) + out = tmpl.substitute(subs) out_fname = os.path.join("public/", out_fname)