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: false in the metadata section of a site to opt-out of discussions

  • thus 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 false in the metadata and need to check for False)

  • add comments: false to all non-blog pages