about summary refs log tree commit diff
diff options
context:
space:
mode:
authoruser <user@node5.net>2024-06-04 19:14:06 +0200
committeruser <user@node5.net>2024-06-04 19:14:06 +0200
commit7e27bc742c5f8b685c8e2efeaec406592bcfa0e2 (patch)
treee9131634154e46f5478ffa8b0a490d0e5f7e3635
parent0d5597a42ab1135e5c41226a66f73fe6011ed32e (diff)
motd - markdown support, tor link
-rw-r--r--blog.node5.net/motd.yml20
-rw-r--r--blog.node5.net/templates/base.html2
-rw-r--r--src/blog_node5_net.py4
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 @@
 <div id="root-container">
     <a id="logo" href="/">
         <h1 class="inline">{{ title }}</h1>
-    </a><p class="grey inline">{{ motd }}</p>
+    </a><span class="grey inline">{{ motd }}</span>
     <hr>
     <br>
     {% 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] = {}