From 2bfa284ecd730c6daaed994bbac0c64de83d481a Mon Sep 17 00:00:00 2001
From: Markus Steinlein <47111718+Ayreonaut@users.noreply.github.com>
Date: Mon, 8 Mar 2021 22:46:49 +0100
Subject: [PATCH] Some cosmetics to blog pages (user icon, hr, date
formatting). Created folder drafts for posts that should be preserved, but
not published yet.
---
app.py | 5 +++++
drafts/slaughterlounge.md | 8 ++++++++
static/css/style.css | 5 +++++
templates/index.html | 2 +-
templates/page.html | 3 ++-
5 files changed, 21 insertions(+), 2 deletions(-)
create mode 100644 drafts/slaughterlounge.md
diff --git a/app.py b/app.py
index 74c7a84..d489686 100755
--- a/app.py
+++ b/app.py
@@ -14,6 +14,10 @@ def markdown_with_jinja_renderer(text):
prerendered_body = render_template_string(text)
return pygmented_markdown(prerendered_body)
+def format_date_string(date_string):
+ date = datetime.strptime(date_string, "%d.%m.%Y")
+ return date.strftime("%d. %B %Y")
+
# create app
app = Flask(__name__)
app.config['FLATPAGES_EXTENSION'] = '.md'
@@ -22,6 +26,7 @@ app.config['FONTAWESOME_STYLES'] = ['solid', 'brands']
# register fotogrid with jinja
app.jinja_env.globals.update(fotogrid=fotogrid)
+app.jinja_env.globals.update(format_date_string=format_date_string)
pages = FlatPages(app)
fa = FontAwesome(app)
diff --git a/drafts/slaughterlounge.md b/drafts/slaughterlounge.md
new file mode 100644
index 0000000..1b45b90
--- /dev/null
+++ b/drafts/slaughterlounge.md
@@ -0,0 +1,8 @@
+title: Slaughterlounge rockt
+date: 05.03.2021
+author: Markus
+description: Slaughterlounge rockt
+
+
+
diff --git a/static/css/style.css b/static/css/style.css
index c66d162..a340e7c 100644
--- a/static/css/style.css
+++ b/static/css/style.css
@@ -57,6 +57,11 @@ h2 {
margin-top:1rem
}
+hr {
+ border: 1px solid #c11012;
+ border-radius: 2px;
+}
+
#sidebar {
flex: 0 0 auto;
padding:2rem
diff --git a/templates/index.html b/templates/index.html
index 98c1719..e799d43 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -6,7 +6,7 @@
{% for page in pages %}
{{ page.title }}
{{ page.description }}
-{{ page.date }}
+{{ format_date_string(page.date) }}
{{page.html|safe }}
- {{ page.author }} {{ page.date }} +