From a46c20ef9365ed9089afc95205998f08441e14ec Mon Sep 17 00:00:00 2001
From: Philipp Oppermann
Date: Sat, 12 Jun 2021 16:12:38 +0200
Subject: [PATCH] Switch comments from utterances to giscus
to use GitHub discussions instead of issues for comment threads.
---
blog/static/css/edition-2/main.css | 8 ++++++++
blog/templates/edition-2/base.html | 2 ++
blog/templates/edition-2/extra.html | 5 +++--
blog/templates/edition-2/page.html | 4 +++-
blog/templates/news-page.html | 3 ++-
blog/templates/snippets.html | 26 +++++++++++++++++++++-----
blog/templates/status-update-page.html | 3 ++-
7 files changed, 41 insertions(+), 10 deletions(-)
diff --git a/blog/static/css/edition-2/main.css b/blog/static/css/edition-2/main.css
index 32587de6..8fc7c411 100644
--- a/blog/static/css/edition-2/main.css
+++ b/blog/static/css/edition-2/main.css
@@ -462,3 +462,11 @@ a strong {
.status-update-list li {
margin-bottom: .5rem;
}
+
+#comments {
+ visibility: hidden;
+}
+
+.comment-directly-on-github {
+ margin-top: 1rem;
+}
diff --git a/blog/templates/edition-2/base.html b/blog/templates/edition-2/base.html
index 628f1aff..f7587a9e 100644
--- a/blog/templates/edition-2/base.html
+++ b/blog/templates/edition-2/base.html
@@ -20,6 +20,8 @@
{% 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 93c98f59..03079415 100644
--- a/blog/templates/edition-2/extra.html
+++ b/blog/templates/edition-2/extra.html
@@ -3,6 +3,7 @@
{% 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) }}
@@ -16,7 +17,7 @@
{% block after_main %}
- Comments
- {{ snippets::utterances() }}
+
+ {{ snippets::giscus() }}
{% endblock after_main %}
diff --git a/blog/templates/edition-2/page.html b/blog/templates/edition-2/page.html
index 799110f1..536d2ec8 100644
--- a/blog/templates/edition-2/page.html
+++ b/blog/templates/edition-2/page.html
@@ -4,6 +4,8 @@
{% import "snippets.html" as snippets %}
{% block title %}{{ page.title }} | {{ config.title }}{% endblock title %}
+{% block head %}{% endblock head %}
+
{% block header %}
{% if lang != "en" -%}
@@ -102,7 +104,7 @@
{% endif %}
- {{ snippets::utterances() }}
+ {{ snippets::giscus() }}