diff options
| author | user@node5.net <user@node5.net> | 2025-07-19 15:18:48 +0200 |
|---|---|---|
| committer | user@node5.net <user@node5.net> | 2025-07-19 15:18:48 +0200 |
| commit | 1de5e27008b309a352f5c967dce253d956e40421 (patch) | |
| tree | 0123534dad29b3c56d3b6d88c55f8cdc4d4b7698 /src/blog_node5_net.py | |
| parent | ddcc24426fbc870d1017d1cf2cf7636936845d18 (diff) | |
Comment section ascii table
Diffstat (limited to 'src/blog_node5_net.py')
| -rw-r--r-- | src/blog_node5_net.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/blog_node5_net.py b/src/blog_node5_net.py index d39fe7f..d22608f 100644 --- a/src/blog_node5_net.py +++ b/src/blog_node5_net.py @@ -10,6 +10,7 @@ import flask import markdown import markupsafe import yaml +import tabulate import article import db_handler @@ -90,11 +91,13 @@ try: except FileNotFoundError as ex: logger.warning("Telegram config - Not found, running without") - @app.context_processor # Always inject site title to all render_templates def inject_common(): + comments, comment_headers = db.get_comments(strip_trailing_slash(flask.request.path)) + comments_formatted = tabulate.tabulate(comments, comment_headers, tablefmt="psql") + args = { - 'comments': db.get_comments(strip_trailing_slash(flask.request.path)) if db else None, + 'comments': comments_formatted, 'title': config['site_root_folder_path'], 'motd': random.choice(motd_list) } |
