Social Comments
Currently, Dream supports these comment systems:
- Disqus (opens in a new tab)
- utterances (opens in a new tab)
- Valine (opens in a new tab)
- Waline (opens in a new tab)
Disqus
In hugo.toml
, set:
[services]
[services.disqus]
shortname = "..."
You may have used disqusShortname = "..."
before. This is deprecated in Hugo 0.120.0
.
Please upgrade to the new configuration. See https://gohugo.io/methods/site/disqusshortname/ (opens in a new tab) for more details.
Disqus comments will be showed on the Single Post Page and About Page.
Compatible with oklch colors
Disqus will detect the color scheme of the website and change the color of the comments accordingly. However, Disqus does not support oklch colors (opens in a new tab) which is used in Dream.
To make Disqus work with Dream, we need to make an extra hack.
First, create a custom css file in static/css/custom.css
:
[data-theme="emerald"] #disqus_thread {
color-scheme: none;
background-color: #fff;
color: #333c4d;
}
[data-theme="forest"] #disqus_thread {
color-scheme: none;
background-color: #171213;
color: #cbc9ca;
}
The background-color
and color
can be obtained by inspecting the website in the browser. Follow below steps:
- Open the devtools in the browser (press
F12
). - Click the
html
tag in theElements
tab. - Then search for
background
in theStyles
tab. - Open the color picker and transfrom the oklch format to hex format.
- Copy them to the custom css file.
After finishing above steps, remember to include this custom css file in customCSS
in hugo.toml
:
[params]
[params.advanced]
customCSS = ["css/custom.css"]
You may want to change the default themes emerald
and forest
to other themes.
Refer to light-and-dark-mode and update background-color
and color
accordingly.
utterances
See: utterancesRepo
The utterances only takes effect on the Single Post Page.
Valine
See: valine
Valine only takes effect on the Single Post Page.
Waline
See: waline
Waline only takes effect on the Single Post Page.