Disable Disqus comments for static pages

I'm using blogdown with the default Lithium theme. With Disqus enabled, all pages accept comments, including static pages e.g. About and Projects. Is there a recommended way to selectively disable Disqus comments on certain pages, while retaining them on the main content pages (i.e., my actual blog posts)?

I'm not sure, but maybe you can take a closer look at templates that Hugo provides. From what I understand, they allow you to have posts with different layouts/themes. Perhaps, it can be done in such a way that only certain posts get to have Disqus.

Thanks, this pointed me in the right direction.

The (Lithium theme) Disqus template starts with:

{{ if and (not (eq .Site.DisqusShortname "")) (not .Params.disable_comments) }}

As I now understand, the .Params.disable_comments is a page variable that can be set in the page's front matter. So adding disable_comments: true turns off comments for that page only.

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.