aboutsummaryrefslogtreecommitdiffstats
path: root/server.py
diff options
context:
space:
mode:
authormjfernez <mjfernez@gmail.com>2021-06-08 11:18:04 -0400
committermjfernez <mjfernez@gmail.com>2021-06-08 11:18:04 -0400
commit1409ff96cdfc4fd6176f36f60fbe86dde1b3b6e4 (patch)
treec731a0a825f1179fb186ff629213fc20158a9c90 /server.py
parenta4ef784946330abc6aed8e03accdf7541881df0f (diff)
downloadezcms-1409ff96cdfc4fd6176f36f60fbe86dde1b3b6e4.tar.gz
Added ability to override templates.
This commit primarily adds the ability to override the base template by adding a '!' on HTML files. It also makes adjustments to the index page display to not show this extra character. Additions to the README reflecting this change, as well as small note on similarity to neocities was added
Diffstat (limited to 'server.py')
-rw-r--r--server.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/server.py b/server.py
index 21ecb2f..15514ba 100644
--- a/server.py
+++ b/server.py
@@ -121,8 +121,9 @@ def render_file(path):
if abs_path.endswith('.html'):
with open(abs_path) as f:
content = f.read()
- print(path.split('/')[-2] + '/')
return render_template_string(CONTENT_BLOCK.replace('$', content), **context)
+ elif abs_path.endswith('.html!'):
+ return render_template("site/" + path, **context)
else:
# not an html file, so don't render it
return send_from_directory('templates/site/', path,