aboutsummaryrefslogtreecommitdiffstats
path: root/views.py
diff options
context:
space:
mode:
authormjfernez <mjf@mjfer.net>2021-12-22 16:59:15 -0500
committermjfernez <mjf@mjfer.net>2021-12-22 16:59:15 -0500
commit283654d9a0d644ec3cd6e9c06898f11ac8effa78 (patch)
tree4cf902620885622fcd48934bd17657c70fd516db /views.py
parent274a23b6fe167d30ce063aa1cc2f07374d18bc04 (diff)
downloadezcms-283654d9a0d644ec3cd6e9c06898f11ac8effa78.tar.gz
Remove site as the parent directory, manual merge
merges needed changes (and CSS) from mjfer.net branch
Diffstat (limited to 'views.py')
-rw-r--r--views.py13
1 files changed, 6 insertions, 7 deletions
diff --git a/views.py b/views.py
index aed9f17..4a41248 100644
--- a/views.py
+++ b/views.py
@@ -18,9 +18,8 @@ CONTENT_BLOCK = (
@app.route("/")
-@app.route("/site")
-@app.route("/site/home.html")
-@app.route("/site/index.html")
+@app.route("/home.html")
+@app.route("/index.html")
@cache.cached()
def home():
"""
@@ -31,13 +30,13 @@ def home():
"""
context = default_context()
context.update(
- {'title': app.config['HOME_TITLE'], 'parent_dir': '/site/'}
+ {'title': app.config['HOME_TITLE'], 'parent_dir': None}
)
return render_template("site/home.html", **context)
# from: https://pythonise.com/series/learning-flask/sending-files-with-flask
-@app.route("/site/<path:path>")
+@app.route("/<path:path>")
@cache.cached()
def render_file(path):
"""
@@ -55,7 +54,7 @@ def render_file(path):
context.update(
{
'title': path.split('.')[0].upper(),
- 'parent_dir': '/site/' + '/'.join(path.split('/')[:-1]),
+ 'parent_dir': '/' + '/'.join(path.split('/')[:-1]),
'last_update': file_last_modified(abs_path),
}
)
@@ -82,7 +81,7 @@ def render_file(path):
dirs, files, links, description = index_dir(abs_path)
context.update(
{
- 'cur_path': 'site/' + path,
+ 'cur_path': path,
'cur_dir': path.split('/')[-1] + '/',
'dirs': dirs,
'files': files,