about summary refs log tree commit diff
path: root/src/blog_node5_net.py
diff options
context:
space:
mode:
authoruser <user@node5.net>2024-02-26 23:17:21 +0100
committeruser <user@node5.net>2024-02-26 23:17:21 +0100
commite0c5d9871ae48e1162e2452749d31e205d2b9960 (patch)
tree80b39ae5d0f678ebde6f560575f3eda59f378dc8 /src/blog_node5_net.py
parent18892c1f8f202988803c4d08fa36fe1d6f87009a (diff)
render folders
Diffstat (limited to 'src/blog_node5_net.py')
-rw-r--r--src/blog_node5_net.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/blog_node5_net.py b/src/blog_node5_net.py
index af26c76..36c5b7f 100644
--- a/src/blog_node5_net.py
+++ b/src/blog_node5_net.py
@@ -17,7 +17,7 @@ folders_by_url: typing.Dict[str, article_handler.Folder] = {}
 articles_by_url: typing.Dict[str, article_handler.Article] = {}
 
 
-@app.context_processor  # Always inject title to all render_templates
+@app.context_processor  # Always inject site title to all render_templates
 def inject_title():
     return {'title': site_root_folder_path}
 
@@ -31,8 +31,8 @@ def view_folder():
     path = flask.request.path
     if path is not '/':
         path = strip_trailing_slash(flask.request.path)
-    a = folders_by_url[path]
-    return 'Folder'
+    folder = folders_by_url[path]
+    return flask.render_template('folder.html', folder=folder)
 
 
 def view_article():
@@ -52,7 +52,7 @@ def register_urls(folder: article_handler.Folder):
         if article.folder_path:
             blueprint_args['static_folder'] = os.path.abspath(article.folder_path)
             blueprint_args['static_url_path'] = ''
-        blueprint = flask.Blueprint(article.title, __name__, url_prefix=article.url, **blueprint_args)
+        blueprint = flask.Blueprint(article.name, __name__, url_prefix=article.url, **blueprint_args)
         blueprint.add_url_rule('/', view_func=view_article)
         app.register_blueprint(blueprint)
         # app.add_url_rule(article.url, view_func=view_article)