From e36882ee20a968ff12617349ed0b9ec432bf7c13 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Fri, 9 Jul 2021 12:00:00 +0100 Subject: [PATCH] Re-add a page for each post tag --- source/_layouts/base.html.twig | 6 +++++- source/_pages/blog.html.twig | 12 ++---------- source/_partials/post/post-teaser.html.twig | 9 +++++++++ source/blog/tags/tag.html | 18 ++++++++++++++++++ 4 files changed, 34 insertions(+), 11 deletions(-) create mode 100644 source/_partials/post/post-teaser.html.twig create mode 100644 source/blog/tags/tag.html diff --git a/source/_layouts/base.html.twig b/source/_layouts/base.html.twig index 533f37631..0feedcceb 100644 --- a/source/_layouts/base.html.twig +++ b/source/_layouts/base.html.twig @@ -8,7 +8,11 @@
-

{{ page.title }}

+

+ {% block page_title %} + {{ page.title }} + {% endblock %} +

{% block content_wrapper %} diff --git a/source/_pages/blog.html.twig b/source/_pages/blog.html.twig index d1c0e96af..b22001c84 100644 --- a/source/_pages/blog.html.twig +++ b/source/_pages/blog.html.twig @@ -8,16 +8,8 @@ intro_text: |
- {% for talk in data.posts|sort((a, b) => a.date < b.date) %} - + {% for post in data.posts|sort((a, b) => a.date < b.date) %} + {% include 'post/post-teaser' with { post } only %} {% endfor %}
diff --git a/source/_partials/post/post-teaser.html.twig b/source/_partials/post/post-teaser.html.twig new file mode 100644 index 000000000..95f648555 --- /dev/null +++ b/source/_partials/post/post-teaser.html.twig @@ -0,0 +1,9 @@ + diff --git a/source/blog/tags/tag.html b/source/blog/tags/tag.html new file mode 100644 index 000000000..d8cfe4dab --- /dev/null +++ b/source/blog/tags/tag.html @@ -0,0 +1,18 @@ +--- +title: Tag Archive +layout: page +generator: + - posts_tag_index +--- + +{% block page_title %} + {{ page.title }}: {{ page.tag }} +{% endblock %} + +{% block content %} +
+ {% for post in page.tag_posts %} + {% include 'post/post-teaser' with { post } only %} + {% endfor %} +
+{% endblock %}