Enabling opt-out for Giscus comments#
I’d like to restrict discussions to blog entries, and want to disable them in the index and other sites.
we previously added a custom templates/layout.html that is unconditionally added to every page
I want to be able to specify
comments: falsein the metadata section of a site to opt-out of discussionsthus guard loading of the script with
{% if 'comments' in meta and meta.comments != 'False' %}note that the check in Jinja is case-sensitive (I specify
falsein the metadata and need to check forFalse)add
comments: falseto all non-blog pages
Enabling discussions for this blog via Giscus
Introduction: this is Felix Schindler