mirror of
https://github.com/phil-opp/blog_os.git
synced 2025-12-16 22:37:49 +00:00
Move comment threads for translated posts to separate category
Avoids that a search for the post title returns a thread for a translated post.
This commit is contained in:
@@ -10,12 +10,20 @@
|
||||
</p>
|
||||
{% endmacro support %}
|
||||
|
||||
{% macro giscus(search_term) %}
|
||||
{% macro giscus(search_term, translated) %}
|
||||
{% if translated %}
|
||||
{% set category = "Post Comments" %}
|
||||
{% set category_path = "post-comments" %}
|
||||
{% else %}
|
||||
{% set category = "Post Comments (translated)" %}
|
||||
{% set category_path = "post-comments-translated" %}
|
||||
{% endif %}
|
||||
|
||||
{% if search_term is number %}
|
||||
{% set discussion_url = "https://github.com/phil-opp/blog_os/discussions/" ~ search_term %}
|
||||
{% else %}
|
||||
{% set search_term_encoded = `"` ~ search_term ~ `"` | urlencode %}
|
||||
{% set discussion_url = `https://github.com/phil-opp/blog_os/discussions/categories/post-comments?discussions_q=` ~ search_term_encoded %}
|
||||
{% set discussion_url = `https://github.com/phil-opp/blog_os/discussions/categories/` ~ category_path ~ `?discussions_q=` ~ search_term_encoded %}
|
||||
{% endif %}
|
||||
|
||||
<p class="comment-note">
|
||||
@@ -27,7 +35,7 @@
|
||||
<script src="https://giscus.app/client.js"
|
||||
data-repo="phil-opp/blog_os"
|
||||
data-repo-id="MDEwOlJlcG9zaXRvcnkzOTU3NTEwMQ=="
|
||||
data-category="Post Comments"
|
||||
data-category="{{ category }}"
|
||||
data-category-id="MDE4OkRpc2N1c3Npb25DYXRlZ29yeTMzMDE4OTg1"
|
||||
{% if search_term is number %}
|
||||
data-mapping="number"
|
||||
|
||||
Reference in New Issue
Block a user