feat: Add now page for 27_09
All checks were successful
Build Docker / BuildImage (push) Successful in 1m35s

This commit is contained in:
2024-09-27 13:34:26 +10:00
parent 9881584cdb
commit 9552df4b4e
4 changed files with 173 additions and 1 deletions

View File

@@ -39,6 +39,9 @@ dotenv.load_dotenv()
handshake_scripts = '<script src="https://nathan.woodburn/handshake.js" domain="nathan.woodburn" async></script><script src="https://nathan.woodburn/https.js" async></script>'
restricted = ["ascii"]
redirects = {
"contact":"/#contact"
}
sites = []
if os.path.isfile("data/sites.json"):
@@ -801,6 +804,10 @@ def catch_all(path: str):
if path.lower().replace(".html", "") in restricted:
return render_template("404.html"), 404
print(path)
if path in redirects:
return redirect(redirects[path], code=302)
# If file exists, load it
if os.path.isfile("templates/" + path):
return render_template(path, handshake_scripts=handshake_scripts, sites=sites)