summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYour Name <you@example.com>2020-09-25 14:15:30 +0200
committerYour Name <you@example.com>2020-09-25 14:15:30 +0200
commitd42e31f55568c3e33bde160a78aea9e8ea809fee (patch)
treef47345541b64be00ee67f2a355ae3809e5bcfbe3
parentd534f8ec61b3c66f4a9101cd06806e0532f26a2a (diff)
downloadrabalderz-d42e31f55568c3e33bde160a78aea9e8ea809fee.tar.gz
rabalderz-d42e31f55568c3e33bde160a78aea9e8ea809fee.tar.bz2
rabalderz-d42e31f55568c3e33bde160a78aea9e8ea809fee.zip
Customize template for film section and pages.
-rw-r--r--content/film/_index.en.md3
-rw-r--r--content/film/_index.md3
-rw-r--r--templates/film/page.html18
-rw-r--r--templates/film/post_header.html36
-rw-r--r--templates/film/section.html33
5 files changed, 91 insertions, 2 deletions
diff --git a/content/film/_index.en.md b/content/film/_index.en.md
index e49d63e..ce3b8f5 100644
--- a/content/film/_index.en.md
+++ b/content/film/_index.en.md
@@ -1,7 +1,8 @@
-
+++
title = "Film"
description = """
Reviews and posts related to films and movies. Mostly in english.
"""
+template = "film/section.html"
+page_template = "film/page.html"
+++
diff --git a/content/film/_index.md b/content/film/_index.md
index 214ef52..2052a4a 100644
--- a/content/film/_index.md
+++ b/content/film/_index.md
@@ -1,7 +1,8 @@
-
+++
title = "Film"
description = """
Omtaler og annet om film og filmrelaterte tema. Disse er hovedsaklig på engelsk.
"""
+template = "film/section.html"
+page_template = "film/page.html"
+++
diff --git a/templates/film/page.html b/templates/film/page.html
new file mode 100644
index 0000000..df4076e
--- /dev/null
+++ b/templates/film/page.html
@@ -0,0 +1,18 @@
+{% extends "base.html" %}
+{% block language %}
+ {% set translations = page.translations %}
+ {% include "translation-links.html" %}
+{% endblock langauge %}
+
+{% block content %}
+{% set post = page -%}
+<article class="post">
+ {% include "film/post_header.html" %}
+ <section class="post-body">
+ {{ post.content | safe }}
+ </section>
+ <footer>
+ {% include "license.html" %}
+ </footer>
+</article>
+{% endblock content %}
diff --git a/templates/film/post_header.html b/templates/film/post_header.html
new file mode 100644
index 0000000..e3d5a29
--- /dev/null
+++ b/templates/film/post_header.html
@@ -0,0 +1,36 @@
+<header>
+ <h1 class="post-title">
+ {{ post.title }}
+ {% if post.extra.country %}
+ ({{ post.extra.country }}{% if post.extra.year %}, {{ post.extra.year }}){% endif %}
+ {% else %}
+ {% if post.extra.year %}({{ post.extra.year }}){% endif %}
+ {% endif %}
+ </h1>
+ <div class="post-meta">
+ <span class="meta-publish">
+ {% if post.date %}Publisert: {{ post.date }}{% endif %}
+ {% if post.taxonomies['authors'] %}av
+ {% for author in post.taxonomies['authors'] -%}
+ <span class="author">
+ <a class="author-link" href="{{ get_taxonomy_url(kind="authors", name=author, lang=lang) | safe }}">
+ {{ author }}
+ </a>
+ </span>
+ {% endfor -%}
+ {% endif %}.
+ </span>
+ {% if post.taxonomies %}
+ <div class="meta-tags">
+ Merket:&nbsp;
+ {% for tag in post.taxonomies['tags'] -%}
+ <span>
+ <a class="tag-link" href="{{ get_taxonomy_url(kind='tags', name=tag, lang=lang) | safe }}">
+ {{ tag }}
+ </a>
+ </span>
+ {% endfor -%}
+ </div>
+ {% endif %}
+ </div>
+</header>
diff --git a/templates/film/section.html b/templates/film/section.html
new file mode 100644
index 0000000..e4d221d
--- /dev/null
+++ b/templates/film/section.html
@@ -0,0 +1,33 @@
+{% extends "base.html" %}
+{% block language %}
+{% set translations = section.translations %}
+{% include "translation-links.html" %}
+{% endblock language %}
+
+{% block content %}
+<h1>{{ section.title }}</h1>
+
+{{ section.description }}
+
+<section class="post-list">
+ {% for post in section.pages | reverse %}
+ <article class="post">
+ {% include "film/post_header.html" %}
+ <section class="post-summary">
+ {% if post.summary %}
+ {{ post.summary | safe }}
+ {% else %}
+ {{ post.content | safe }}
+ {% endif %}
+ </section>
+ <footer>
+ {% if post.summary %}
+ <a href="{{ post.permalink }}">
+ {{ trans(key="moreprompt", lang=post.lang) }}
+ </a>
+ {% endif %}
+ </footer>
+ </article>
+ {% endfor %}
+</section>
+{% endblock content %}