From 47292beaad2e8b087e521a84766fafd69b320400 Mon Sep 17 00:00:00 2001
From: Philipp Oppermann
Date: Sat, 12 Jun 2021 16:35:20 +0200
Subject: [PATCH] giscus: Use specific search term instead of `og:title`
This makes us more flexible and gives us ways to avoid title collisions (e.g. when the title on an extra post is a substring of some post title).
---
blog/templates/edition-2/base.html | 2 --
blog/templates/edition-2/extra.html | 3 +--
blog/templates/edition-2/page.html | 3 +--
blog/templates/news-page.html | 3 +--
blog/templates/snippets.html | 11 +++--------
blog/templates/status-update-page.html | 3 +--
6 files changed, 7 insertions(+), 18 deletions(-)
diff --git a/blog/templates/edition-2/base.html b/blog/templates/edition-2/base.html
index f7587a9e..628f1aff 100644
--- a/blog/templates/edition-2/base.html
+++ b/blog/templates/edition-2/base.html
@@ -20,8 +20,6 @@
{% block title %}{% endblock title %}
-
- {% block head %}{% endblock head %}
diff --git a/blog/templates/edition-2/extra.html b/blog/templates/edition-2/extra.html
index 03079415..e6bb8d86 100644
--- a/blog/templates/edition-2/extra.html
+++ b/blog/templates/edition-2/extra.html
@@ -3,7 +3,6 @@
{% import "snippets.html" as snippets %}
{% block title %}{{ page.title }} | {{ config.title }}{% endblock title %}
-{% block head %}{% endblock head %}
{% block description -%}
{{ page.summary | safe | striptags | truncate(length=150) }}
@@ -18,6 +17,6 @@
Comments
- {{ snippets::giscus() }}
+ {{ snippets::giscus(search_term=page.title ~ " (Extra Post)") }}
{% endblock after_main %}
diff --git a/blog/templates/edition-2/page.html b/blog/templates/edition-2/page.html
index 536d2ec8..a611b867 100644
--- a/blog/templates/edition-2/page.html
+++ b/blog/templates/edition-2/page.html
@@ -4,7 +4,6 @@
{% import "snippets.html" as snippets %}
{% block title %}{{ page.title }} | {{ config.title }}{% endblock title %}
-{% block head %}{% endblock head %}
{% block header %}
{% if lang != "en" -%}
@@ -104,7 +103,7 @@