From 7e27bc742c5f8b685c8e2efeaec406592bcfa0e2 Mon Sep 17 00:00:00 2001 From: user Date: Tue, 4 Jun 2024 19:14:06 +0200 Subject: motd - markdown support, tor link --- blog.node5.net/motd.yml | 20 ++++++++++---------- blog.node5.net/templates/base.html | 2 +- src/blog_node5_net.py | 4 +++- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/blog.node5.net/motd.yml b/blog.node5.net/motd.yml index 51d9880..ad9c058 100644 --- a/blog.node5.net/motd.yml +++ b/blog.node5.net/motd.yml @@ -1,10 +1,10 @@ -- Hosted in a bunker, no really -- 100% Biodegradable, contains 0 JavaScript -- Available over legacy IP and IPv6 -- Available as a TOR hidden service, see tor.node5.net -- BTW I run Arch -- Hosted on Debian -- Enriched by PostgreSQL -- Running Python Flask -- Self-hosted! -- "#Instagram4nerds" +Hosted in a bunker, no really +100% Biodegradable, contains 0 JavaScript +Available over legacy IP and IPv6 +Available as a TOR hidden service, see [tor.node5.net](http://node5net2j2kvsepjjlbnovz6wwpcclur3ecuadmo36cikjriqxaucid.onion) +BTW I run Arch +Hosted on Debian +Enriched by PostgreSQL +Running Python Flask +Self-hosted! +\#Instagram4nerds \ No newline at end of file diff --git a/blog.node5.net/templates/base.html b/blog.node5.net/templates/base.html index dc4d6bb..61a5859 100644 --- a/blog.node5.net/templates/base.html +++ b/blog.node5.net/templates/base.html @@ -14,7 +14,7 @@

{{ motd }}

+ {{ motd }}

{% block content %} diff --git a/src/blog_node5_net.py b/src/blog_node5_net.py index 86258d2..121c8f3 100644 --- a/src/blog_node5_net.py +++ b/src/blog_node5_net.py @@ -7,6 +7,8 @@ import typing import urllib import flask +import markdown +import markupsafe import yaml import article @@ -71,7 +73,7 @@ app = flask.Flask(__name__, template_folder=os.path.join('..', config['site_root static_folder=os.path.join('..', config['site_root_folder_path'], 'static'), static_url_path='') with open(os.path.join(config['site_root_folder_path'], 'motd.yml'), 'r') as file: - motd_list = yaml.safe_load(file.read()) + motd_list = [markupsafe.Markup(markdown.markdown(line)) for line in file.readlines()] folders_by_url: typing.Dict[str, article.Folder] = {} articles_by_url: typing.Dict[str, article.Article] = {} -- cgit v1.2.3