From d42e31f55568c3e33bde160a78aea9e8ea809fee Mon Sep 17 00:00:00 2001 From: Your Name Date: Fri, 25 Sep 2020 14:15:30 +0200 Subject: Customize template for film section and pages. --- content/film/_index.en.md | 3 ++- content/film/_index.md | 3 ++- templates/film/page.html | 18 ++++++++++++++++++ templates/film/post_header.html | 36 ++++++++++++++++++++++++++++++++++++ templates/film/section.html | 33 +++++++++++++++++++++++++++++++++ 5 files changed, 91 insertions(+), 2 deletions(-) create mode 100644 templates/film/page.html create mode 100644 templates/film/post_header.html create mode 100644 templates/film/section.html 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 -%} +
+ {% include "film/post_header.html" %} +
+ {{ post.content | safe }} +
+
+ {% include "license.html" %} +
+
+{% 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 @@ +
+

+ {{ 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 %} +

+ +
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 %} +

{{ section.title }}

+ +{{ section.description }} + +
+ {% for post in section.pages | reverse %} + + {% endfor %} +
+{% endblock content %} -- cgit v1.2.3