diff options
author | mjfernez <mjfernez@gmail.com> | 2021-06-08 11:18:04 -0400 |
---|---|---|
committer | mjfernez <mjfernez@gmail.com> | 2021-06-08 11:18:04 -0400 |
commit | 1409ff96cdfc4fd6176f36f60fbe86dde1b3b6e4 (patch) | |
tree | c731a0a825f1179fb186ff629213fc20158a9c90 /server.py | |
parent | a4ef784946330abc6aed8e03accdf7541881df0f (diff) | |
download | ezcms-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.py | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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, |