about summary refs log tree commit diff
diff options
context:
space:
mode:
authoruser <user@node5.net>2024-06-04 21:58:02 +0200
committeruser <user@node5.net>2024-06-04 21:58:02 +0200
commit3584e162949650a8f6b1e7aff1fdb2a69c62fad1 (patch)
tree228673488486d7ea759f24d7cdf10d0dd227c770
parent0fcb492ff2144012a97857be2f19f33f822134c0 (diff)
motd - file extension, test endpoint, image styling
-rw-r--r--blog.node5.net/motd.md (renamed from blog.node5.net/motd.yml)0
-rw-r--r--blog.node5.net/static/main.css4
-rw-r--r--blog.node5.net/templates/base.html2
-rw-r--r--src/blog_node5_net.py7
4 files changed, 11 insertions, 2 deletions
diff --git a/blog.node5.net/motd.yml b/blog.node5.net/motd.md
index 03cea3a..03cea3a 100644
--- a/blog.node5.net/motd.yml
+++ b/blog.node5.net/motd.md
diff --git a/blog.node5.net/static/main.css b/blog.node5.net/static/main.css
index 9747bf0..10463be 100644
--- a/blog.node5.net/static/main.css
+++ b/blog.node5.net/static/main.css
@@ -120,4 +120,8 @@ label{
 
 .width-100{
     width: 100%;
+}
+
+#motd img{
+max-height: 2em;
 }
\ No newline at end of file
diff --git a/blog.node5.net/templates/base.html b/blog.node5.net/templates/base.html
index 61a5859..fccbeb1 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><span class="grey inline">{{ motd }}</span>
+    </a><span id="motd" class="grey inline">{{ motd }}</span>
     <hr>
     <br>
     {% block content %}
diff --git a/src/blog_node5_net.py b/src/blog_node5_net.py
index 121c8f3..ee6185b 100644
--- a/src/blog_node5_net.py
+++ b/src/blog_node5_net.py
@@ -72,7 +72,7 @@ if len(sys.argv) > 1 and sys.argv[1] == 'validate':
 app = flask.Flask(__name__, template_folder=os.path.join('..', config['site_root_folder_path'], 'templates'),
                   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:
+with open(os.path.join(config['site_root_folder_path'], 'motd.md'), 'r') as file:
     motd_list = [markupsafe.Markup(markdown.markdown(line)) for line in file.readlines()]
 
 folders_by_url: typing.Dict[str, article.Folder] = {}
@@ -96,6 +96,11 @@ def strip_trailing_slash(path):
     return path
 
 
+@app.route('/motd')
+def motd_debug():
+    return '\n'.join(motd_list)
+
+
 @app.route('/comment', methods=['POST'])
 def post_comment():
     args = {'page_url': strip_trailing_slash(urllib.parse.unquote(urllib.parse.urlparse(flask.request.referrer).path)),