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) }}


{% endfor %} {% endblock %} diff --git a/templates/page.html b/templates/page.html index 74d52ec..aeb627e 100644 --- a/templates/page.html +++ b/templates/page.html @@ -2,5 +2,6 @@ {% block content %}

{{ page.title }}

{{page.html|safe }}

- {{ page.author }} {{ page.date }} +
+  {{ page.author }} — {{ format_date_string(page.date) }} {% endblock %}