Add Disqus comment system to hugo site
Contents
1 Setup account
- Go to disqus.com and create account
- e-mail verification
- At disqus.com/home, go to cog mark > “Add Disqus to site” > “Install Disqus”
- Select plan > Basic
- Install Disqus > “I don’t see my platform listed, install manually with Universal Code”. See tutorial video
- Check embed code and java script link (option for counting comment)
- Check document about Use configuration variables to avoid thread and missing comment
- Configure
- Website name
- Category (e.g. Tech)
- Language (e.g. English)
- (optional) I added comment policy, like “We welcome relevant and respectful comment. Off-topic comments may be removed.
- (optional) Appearance (e.g. color scheme: Auto, Typeface: Auto)
- Setup moderation
- e.g. Balanced
- Check shortname
- Disqus.com > Admin > Settings > Shortname
- Ref. Discus document - What is a shortname
2 Setup on hugo (LoveIt themere)
Hugo supports to configure Disqus comment system. In detail, see document.
LoveIt theme implement embedded code in theme/LoveIt/layouts/partials.html
and comment is generated by LoveIt/layouts/_default/single.html
.
For enabling this, just configure:
config.toml
|
|
3 Additional configuration
Disqus.com > Admin > Settings
- Moderation
- Guest Commenting > Allow guest to comment
- Ads
- (disable) Allow ads within comments
- (disable) Allow ads below the comments
- Reaction
- Prompt: “What do you think?”
- Include Images: “yes”
4 Confirm locally
As per - hugoloveit - basic documentation,
Due to limitations in the local
development
environment, the comment system, CDN and fingerprint will not be enabled in the development environment.You could enable these features with
hugo serve -e production
.
|
|
Then you can check how comment is displayed for each posted page locally.