-
-
Notifications
You must be signed in to change notification settings - Fork 360
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to enable Disqus comments #4
base: master
Are you sure you want to change the base?
Conversation
295102e
to
8452188
Compare
daff20e
to
bb60546
Compare
This will lead to comments block appearing on the main page also. |
Yes, and you can load comments conditionally, e.g. https://github.com/yihui/hugo-lithium-theme/blob/master/layouts/partials/disqus.html#L1 Use a parameter |
Thanks, yihui |
@histrio Please see https://gohugo.io/variables/page/ for more available variables that you can use. |
@histrio easiest way is to simply add it to the single.html template above the footer instead of the footer template itself. Then it won't show up on the main page or list pages. |
@oneleaftea I resolve it like this
in |
You could create /post sub folder in layout folder and create custom single.html. This will also prevent comments section to appear on other pages except posts. |
I have most of this working on both xmin and learn patterns as described above: So I am making only one change (outside of config.toml) to foot_custom.html. However adding disable_comments: false or disable_comments: true to the front matter of a page makes no difference - I always get disqus enabled i.e. it shows up at the foot when deployed to netlify. I'd like to suppress comments on some pages. |
b6578bf
to
2b4c7dc
Compare
To make sure comments are only enabled under posts, @oneleaftea's suggestion can be tweaked slightly:
|
Add
{{ template "_internal/disqus.html" . }}
tofoot_custom.html
, and configure the Disqus shortname inconfig.toml
.Preview: https://deploy-preview-4--hugo-xmin.netlify.com/