mirror of
https://github.com/phil-opp/blog_os.git
synced 2025-12-16 22:37:49 +00:00
giscus: Use specific search term instead of og:title
This makes us more flexible and gives us ways to avoid title collisions (e.g. when the title on an extra post is a substring of some post title).
This commit is contained in:
@@ -10,21 +10,16 @@
|
||||
</p>
|
||||
{% endmacro support %}
|
||||
|
||||
{% macro giscus(discussion_number=0) %}
|
||||
{% macro giscus(search_term) %}
|
||||
<div class="giscus"></div>
|
||||
|
||||
{% if discussion_number == 0 %}
|
||||
{% set discussion_mapping="og:title" %}
|
||||
{% else %}
|
||||
{% set discussion_mapping="number" %}
|
||||
{% endif %}
|
||||
|
||||
<script src="https://giscus.app/client.js"
|
||||
data-repo="phil-opp/blog_os"
|
||||
data-repo-id="MDEwOlJlcG9zaXRvcnkzOTU3NTEwMQ=="
|
||||
data-category="Post Comments"
|
||||
data-category-id="MDE4OkRpc2N1c3Npb25DYXRlZ29yeTMzMDE4OTg1"
|
||||
data-mapping="og:title"
|
||||
data-mapping="specific"
|
||||
data-term="{{ search_term }}"
|
||||
data-reactions-enabled="1"
|
||||
data-theme="preferred_color_scheme"
|
||||
crossorigin="anonymous"
|
||||
|
||||
Reference in New Issue
Block a user