diff options
Diffstat (limited to 'templates')
-rw-r--r-- | templates/page.html | 18 | ||||
-rw-r--r-- | templates/posts/header.html | 21 | ||||
-rw-r--r-- | templates/section.html | 18 |
3 files changed, 27 insertions, 30 deletions
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 -%} <article class="post"> - <h1>{{ page.title }}</h1> - <div class="meta"> - <span class="meta-publish"> - Publisert: {{ page.date }} - {% if page.author %}av {{ page.author }}{% endif %} - </span> - {% if page.taxonomies %} - <span class="meta-tags"> - Merket: {{ page.taxonomies['tags'] | join(sep=", ") }} - </span> - {% endif %} - </div> - {{ page.content | safe }} + {% include "posts/header.html" %} + <section class="post-body"> + {{ post.content | safe }} + </section> </article> {% 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 @@ +<header> + <h1 class="post-title">{{ post.title }}</h1> + <div class="post-meta"> + <span class="meta-publish"> + Publisert: {{ post.date }} + {% if post.extra.author %}av {{ post.extra.author }}{% endif %} + </span> + {% if post.taxonomies %} + <div class="meta-tags"> + Merket: + {% for tag in post.taxonomies['tags'] -%} + <span> + <a class="tag-link" href="{{ get_taxonomy_url(kind='tags', name=tag) | safe }}"> + {{ tag }} + </a> + </span> + {% endfor -%} + </div> + {% endif %} + </div> +</header> 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 @@ <section class="post-list"> {% for post in section.pages | reverse %} <article class="post"> - <header class="post-header"> - <div class="post-meta"> - {{ post.date }} - {% if post.taxonomies["tags"] | length > 0 %} - <ul class="post-tags"> - {% for tag in post.taxonomies["tags"] %} - <li class="tag">{{ tag }}</li> - {% endfor %} - </ul> - {% endif %} - </div> - <h1 class="post-title"> - <a href="{{ post.permalink | safe }}"> - {{ post.title }} - </a> - </h1> - </header> + {% include "posts/header.html" %} <section class="post-summary"> {% if post.summary %} {{ post.summary | safe }} |