aboutsummaryrefslogtreecommitdiffstats
path: root/views.py
diff options
context:
space:
mode:
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,