mirror of
https://github.com/phil-opp/blog_os.git
synced 2025-12-16 14:27:49 +00:00
Merge pull request #1118 from phil-opp/translate-giscus
Translate the giscus comment system
This commit is contained in:
@@ -17,6 +17,6 @@
|
|||||||
<hr>
|
<hr>
|
||||||
<section>
|
<section>
|
||||||
<h2 id="comments">Comments</h2>
|
<h2 id="comments">Comments</h2>
|
||||||
{{ snippets::giscus(search_term=page.title ~ " (Extra Post)", translated=false) }}
|
{{ snippets::giscus(search_term=page.title ~ " (Extra Post)", lang=page.lang) }}
|
||||||
</section>
|
</section>
|
||||||
{% endblock after_main %}
|
{% endblock after_main %}
|
||||||
|
|||||||
@@ -118,12 +118,7 @@
|
|||||||
{% else %}
|
{% else %}
|
||||||
{% set search_term=page.title %}
|
{% set search_term=page.title %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if page.lang != "en" %}
|
{{ snippets::giscus(search_term=search_term, lang=page.lang) }}
|
||||||
{% set translated = true %}
|
|
||||||
{% else %}
|
|
||||||
{% set translated = false %}
|
|
||||||
{% endif %}
|
|
||||||
{{ snippets::giscus(search_term=search_term, translated=translated) }}
|
|
||||||
|
|
||||||
{%- if page.lang != "en" %}
|
{%- if page.lang != "en" %}
|
||||||
<p class="{% if page.extra.rtl %}right-to-left{% endif %}">
|
<p class="{% if page.extra.rtl %}right-to-left{% endif %}">
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
<hr>
|
<hr>
|
||||||
<section>
|
<section>
|
||||||
<h2 id="comments">Comments</h2>
|
<h2 id="comments">Comments</h2>
|
||||||
{{ snippets::giscus(search_term=page.title ~ " (News Post)", translated=false) }}
|
{{ snippets::giscus(search_term=page.title ~ " (News Post)", lang=page.lang) }}
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
{% endblock after_main %}
|
{% endblock after_main %}
|
||||||
|
|||||||
@@ -10,8 +10,8 @@
|
|||||||
</p>
|
</p>
|
||||||
{% endmacro support %}
|
{% endmacro support %}
|
||||||
|
|
||||||
{% macro giscus(search_term, translated) %}
|
{% macro giscus(search_term, lang) %}
|
||||||
{% if translated %}
|
{% if lang != "en" %}
|
||||||
{% set category = "Post Comments (translated)" %}
|
{% set category = "Post Comments (translated)" %}
|
||||||
{% set category_path = "post-comments-translated" %}
|
{% set category_path = "post-comments-translated" %}
|
||||||
{% else %}
|
{% else %}
|
||||||
@@ -46,6 +46,7 @@
|
|||||||
data-reactions-enabled="1"
|
data-reactions-enabled="1"
|
||||||
data-emit-metadata="1"
|
data-emit-metadata="1"
|
||||||
data-theme="preferred_color_scheme"
|
data-theme="preferred_color_scheme"
|
||||||
|
data-lang="{{ lang }}"
|
||||||
crossorigin="anonymous"
|
crossorigin="anonymous"
|
||||||
async>
|
async>
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -32,7 +32,7 @@
|
|||||||
<hr>
|
<hr>
|
||||||
<section>
|
<section>
|
||||||
<h2 id="comments">Comments</h2>
|
<h2 id="comments">Comments</h2>
|
||||||
{{ snippets::giscus(search_term=page.title, translated=false) }}
|
{{ snippets::giscus(search_term=page.title, lang=page.lang) }}
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
{% endblock after_main %}
|
{% endblock after_main %}
|
||||||
|
|||||||
Reference in New Issue
Block a user