From 1383fee0f3ee632110259218a20fbf5446814fd2 Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Sat, 6 Jun 2020 17:26:51 +0200 Subject: Refactor post headers to separate template. --- sass/styles.scss | 7 ++----- templates/page.html | 18 +++++------------- templates/posts/header.html | 21 +++++++++++++++++++++ templates/section.html | 18 +----------------- 4 files changed, 29 insertions(+), 35 deletions(-) create mode 100644 templates/posts/header.html diff --git a/sass/styles.scss b/sass/styles.scss index f4e6ea9..87bb0d1 100644 --- a/sass/styles.scss +++ b/sass/styles.scss @@ -43,16 +43,13 @@ pre { } .post-title { - margin-top: 0; + margin-bottom: 0; } .post-meta { - display: flex; - justify-content: space-between; font-size: x-small; - .post-tags { + .meta-tags { display: flex; - list-style: none; * + * { &::before { content: ", " diff --git a/templates/page.html b/templates/page.html index 5cdf946..49f3cd5 100644 --- a/templates/page.html +++ b/templates/page.html @@ -1,18 +1,10 @@ {% extends "base.html" %} {% block content %} +{% set post = page -%}
-

{{ page.title }}

-
- - Publisert: {{ page.date }} - {% if page.author %}av {{ page.author }}{% endif %} - - {% if page.taxonomies %} - - Merket: {{ page.taxonomies['tags'] | join(sep=", ") }} - - {% endif %} -
- {{ page.content | safe }} + {% include "posts/header.html" %} +
+ {{ post.content | safe }} +
{% endblock content %} diff --git a/templates/posts/header.html b/templates/posts/header.html new file mode 100644 index 0000000..0266f6e --- /dev/null +++ b/templates/posts/header.html @@ -0,0 +1,21 @@ +
+

{{ post.title }}

+ +
diff --git a/templates/section.html b/templates/section.html index b65fdf1..fed7472 100644 --- a/templates/section.html +++ b/templates/section.html @@ -7,23 +7,7 @@
{% for post in section.pages | reverse %}
-
- -

- - {{ post.title }} - -

-
+ {% include "posts/header.html" %}
{% if post.summary %} {{ post.summary | safe }} -- cgit v1.2.3