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. --- templates/page.html | 18 +++++------------- templates/posts/header.html | 21 +++++++++++++++++++++ templates/section.html | 18 +----------------- 3 files changed, 27 insertions(+), 30 deletions(-) create mode 100644 templates/posts/header.html (limited to 'templates') 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