Add note above comments and link to GitHub discussion

This commit is contained in:
Philipp Oppermann
2021-10-16 15:20:12 +02:00
parent 9dd6588edf
commit 5654201a09
2 changed files with 14 additions and 7 deletions

View File

@@ -463,10 +463,6 @@ a strong {
margin-bottom: .5rem; margin-bottom: .5rem;
} }
#comments { .giscus {
visibility: hidden; margin-top: 1.5rem;
}
.comment-directly-on-github {
margin-top: 1rem;
} }

View File

@@ -11,6 +11,16 @@
{% endmacro support %} {% endmacro support %}
{% macro giscus(search_term) %} {% 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 %}
<p class="comment-note">
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 <a href="https://www.rust-lang.org/policies/code-of-conduct">code of conduct</a>. This comment thread directly maps to a <a href="{{ discussion_url }}"><em>discussion on GitHub</em></a>, so you can also comment there if you prefer.
</p>
<div class="giscus"></div> <div class="giscus"></div>
<script src="https://giscus.app/client.js" <script src="https://giscus.app/client.js"
@@ -25,12 +35,13 @@
{% endif %} {% endif %}
data-term="{{ search_term }}" data-term="{{ search_term }}"
data-reactions-enabled="1" data-reactions-enabled="1"
data-emit-metadata="1"
data-theme="preferred_color_scheme" data-theme="preferred_color_scheme"
crossorigin="anonymous" crossorigin="anonymous"
async> async>
</script> </script>
<p class="comment-directly-on-github"> <p class="comment-directly-on-github">
Instead of authenticating the <a href="https://giscus.app">giscus</a> application, you can also comment directly on the <span class="discussion_link">on GitHub. Just click the <i>"X comments"</i> link at the <a href="#comments">top</a> — or the date of any comment — to go to the GitHub discussion.</span> Instead of authenticating the <a href="https://giscus.app">giscus</a> application, you can also comment directly <a href="{{ discussion_url }}"><em>on GitHub</em></a>.
</p> </p>
{% endmacro giscus %} {% endmacro giscus %}