From 3dde6ffb1cf4da3f3c1c8b8712cda74fae2e7ee2 Mon Sep 17 00:00:00 2001
From: magicfelix <felix@felix-zauberer.de>
Date: Tue, 8 Oct 2024 21:13:22 +0200
Subject: [PATCH] Do not show related posts on blog posts

---
 templates/blog/post.html           |  1 +
 templates/pages/content.html       | 11 ++++++++++-
 templates/pages/related_posts.html | 24 +++++++++---------------
 3 files changed, 20 insertions(+), 16 deletions(-)

diff --git a/templates/blog/post.html b/templates/blog/post.html
index defa153b..ef7b1148 100644
--- a/templates/blog/post.html
+++ b/templates/blog/post.html
@@ -37,6 +37,7 @@
           </div>
         </div>
       </div>
+      {% block related_posts %}{% endblock %}
     </div>
   </div>
 {% endblock %}
diff --git a/templates/pages/content.html b/templates/pages/content.html
index 701ce94e..db8c4266 100644
--- a/templates/pages/content.html
+++ b/templates/pages/content.html
@@ -17,5 +17,14 @@
       {% endblock content %}
     </div>
   </section>
-  {% include "pages/related_posts.html" %}
+  {% block related_posts %}
+    {% set blog_section = get_section(path="blog/_index.md") %}
+    <section class="section" resource="{{ blog_section.permalink }}" typeof="schema:Blog">
+      <meta property="schema:publisher" href="https://teckids.org/" />
+      <div class="container">
+        <h2 class="title is-2">{{ title | default(value="Aus dem Teckids-Blog") }}</h2>
+        {% include "pages/related_posts.html" %}
+      </div>
+    </section>
+  {% endblock %}
 {% endblock %}
diff --git a/templates/pages/related_posts.html b/templates/pages/related_posts.html
index 26fafd9b..8ff2a7bb 100644
--- a/templates/pages/related_posts.html
+++ b/templates/pages/related_posts.html
@@ -1,16 +1,10 @@
 {% set blog_section = get_section(path="blog/_index.md") %}
-<section class="section" resource="{{ blog_section.permalink }}" typeof="schema:Blog">
-  <meta property="schema:publisher" href="https://teckids.org/" />
-  <div class="container">
-    <h2 class="title is-2">{{ title | default(value="Aus dem Teckids-Blog") }}</h2>
-    <div class="columns is-multiline is-same-height mt-4">
-      {% for post in blog_section.pages %}
-        {% if "aspekt" in post.taxonomies and page.title in post.taxonomies["aspekt"] %}
-          <div class="column is-one-third">
-            {% include "blog/card.html" %}
-          </div>
-	{% else %}{% continue %}{% endif %}
-      {% endfor %}
-    </div>
-  </div>
-</section>
+<div class="columns is-multiline is-same-height mt-4">
+  {% for post in blog_section.pages %}
+    {% if "aspekt" in post.taxonomies and page.title in post.taxonomies["aspekt"] %}
+      <div class="column is-one-third">
+        {% include "blog/card.html" %}
+      </div>
+    {% else %}{% continue %}{% endif %}
+  {% endfor %}
+</div>
-- 
GitLab