Merge branch 'main' into edition-3

This commit is contained in:
Philipp Oppermann
2022-12-18 11:44:21 +01:00
64 changed files with 10343 additions and 947 deletions

View File

@@ -39,8 +39,6 @@
</small>
</footer>
</div>
<script data-goatcounter="https://phil-opp.goatcounter.com/count" async src="//gc.zgo.at/count.js"></script>
</body>
</html>

View File

@@ -35,11 +35,11 @@
{% block after_main %}
<hr>
<div class="PageNavigation">
{% if page.lighter %}
<a class="prev" href="{{ page.lighter.path | safe }}">&laquo; {{ page.lighter.title }}</a>
{% if page.lower %}
<a class="prev" href="{{ page.lower.path | safe }}">&laquo; {{ page.lower.title }}</a>
{% endif %}
{% if page.heavier %}
<a class="next" href="{{ page.heavier.path | safe }}">{{ page.heavier.title }} &raquo;</a>
{% if page.higher %}
<a class="next" href="{{ page.higher.path | safe }}">{{ page.higher.title }} &raquo;</a>
{% endif %}
</div>

View File

@@ -62,8 +62,6 @@
</small>
</footer>
</div>
<script data-goatcounter="https://phil-opp.goatcounter.com/count" async src="//gc.zgo.at/count.js"></script>
</body>
</html>

View File

@@ -17,6 +17,6 @@
<hr>
<section>
<h2 id="comments">Comments</h2>
{{ snippets::giscus(search_term=page.title ~ " (Extra Post)") }}
{{ snippets::giscus(search_term=page.title ~ " (Extra Post)", lang=page.lang) }}
</section>
{% endblock after_main %}

View File

@@ -17,7 +17,7 @@
<hr>
<section>
<h2 id="comments">Comments</h2>
{{ snippets::giscus(search_term=page.title ~ " (News Post)") }}
{{ snippets::giscus(search_term=page.title ~ " (News Post)", lang=page.lang) }}
</section>
{% endblock after_main %}

View File

@@ -69,6 +69,18 @@
{%- endif -%}
<a href="https://github.com/{{user}}">@{{user}}</a>
{%- endfor %}.
{%- if page.extra.translation_contributors %}
<span class="translation_contributors">
{{ trans(key="translation_contributors", lang=lang) }} {% for user in page.extra.translation_contributors -%}
{%- if not loop.first -%}
{%- if loop.last %} {{ trans(key="word_separator", lang=lang) }} {% else %}, {% endif -%}
{%- endif -%}
<a href="https://github.com/{{user}}">@{{user}}</a>
{%- endfor %}.
</span>
{% endif -%}
</p>
{% endif -%}
</div>
@@ -85,11 +97,11 @@
<hr>
<div class="PageNavigation">
{% if page.lighter %}
<a class="prev" href="{{ page.lighter.path | safe }}">&laquo; {{ page.lighter.title }}</a>
{% if page.lower %}
<a class="prev" href="{{ page.lower.path | safe }}">&laquo; {{ page.lower.title }}</a>
{% endif %}
{% if page.heavier %}
<a class="next" href="{{ page.heavier.path | safe }}">{{ page.heavier.title }} &raquo;</a>
{% if page.higher %}
<a class="next" href="{{ page.higher.path | safe }}">{{ page.higher.title }} &raquo;</a>
{% endif %}
</div>
@@ -106,7 +118,7 @@
{% else %}
{% set search_term=page.title %}
{% endif %}
{{ snippets::giscus(search_term=search_term) }}
{{ snippets::giscus(search_term=search_term, lang=page.lang) }}
{%- if page.lang != "en" %}
<p class="{% if page.extra.rtl %}right-to-left{% endif %}">

View File

@@ -7,12 +7,20 @@
</p>
{% endmacro support %}
{% macro giscus(search_term) %}
{% macro giscus(search_term, lang) %}
{% if lang != "en" %}
{% set category = "Post Comments (translated)" %}
{% set category_path = "post-comments-translated" %}
{% else %}
{% set category = "Post Comments" %}
{% set category_path = "post-comments" %}
{% 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">
@@ -24,7 +32,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"
@@ -35,6 +43,7 @@
data-reactions-enabled="1"
data-emit-metadata="1"
data-theme="preferred_color_scheme"
data-lang="{{ lang }}"
crossorigin="anonymous"
async>
</script>

View File

@@ -22,17 +22,17 @@
{% block after_main %}
<hr>
<div class="PageNavigation">
{% if page.earlier %}
<a class="prev" href="{{ page.earlier.path | safe }}">&laquo; {{ page.earlier.title }}</a>
{% if page.lower %}
<a class="prev" href="{{ page.lower.path | safe }}">&laquo; {{ page.lower.title }}</a>
{% endif %}
{% if page.later %}
<a class="next" href="{{ page.later.path | safe }}">{{ page.later.title }} &raquo;</a>
{% if page.higher %}
<a class="next" href="{{ page.higher.path | safe }}">{{ page.higher.title }} &raquo;</a>
{% endif %}
</div>
<hr>
<section>
<h2 id="comments">Comments</h2>
{{ snippets::giscus(search_term=page.title) }}
{{ snippets::giscus(search_term=page.title, lang=page.lang) }}
</section>
{% endblock after_main %}