From 5654201a09f4375e350c59f3038e801915297df1 Mon Sep 17 00:00:00 2001 From: Philipp Oppermann Date: Sat, 16 Oct 2021 15:20:12 +0200 Subject: [PATCH] Add note above comments and link to GitHub discussion --- blog/static/css/edition-2/main.css | 8 ++------ blog/templates/snippets.html | 13 ++++++++++++- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/blog/static/css/edition-2/main.css b/blog/static/css/edition-2/main.css index 8fc7c411..444ee719 100644 --- a/blog/static/css/edition-2/main.css +++ b/blog/static/css/edition-2/main.css @@ -463,10 +463,6 @@ a strong { margin-bottom: .5rem; } -#comments { - visibility: hidden; -} - -.comment-directly-on-github { - margin-top: 1rem; +.giscus { + margin-top: 1.5rem; } diff --git a/blog/templates/snippets.html b/blog/templates/snippets.html index 14e34a42..452fed9a 100644 --- a/blog/templates/snippets.html +++ b/blog/templates/snippets.html @@ -11,6 +11,16 @@ {% endmacro support %} {% macro giscus(search_term) %} + {% if search_term is number %} + {% set discussion_url = "https://github.com/phil-opp/blog_os/discussions/" ~ search_term %} + {% else %} + {% set discussion_url = `https://github.com/phil-opp/blog_os/discussions/categories/post-comments?discussions_q="` ~ search_term ~ `"` %} + {% endif %} + +

+ Do you have a problem, want to share feedback, or discuss further ideas? Feel free to leave a comment here! Please stick to English and follow Rust's code of conduct. This comment thread directly maps to a discussion on GitHub, so you can also comment there if you prefer. +

+

- Instead of authenticating the giscus application, you can also comment directly on the on GitHub. Just click the "X comments" link at the top — or the date of any comment — to go to the GitHub discussion. + Instead of authenticating the giscus application, you can also comment directly on GitHub.

{% endmacro giscus %}