mirror of https://github.com/lxndrblz/anatole.git

Alexander Bilz
13.26.2021 742ac9a244038c26ab8a6847be70456ca215a273
Added Commento Comments

Closes #156
1 files added
3 files modified
22 ■■■■■ changed files
README.md 10 ●●●●● patch | view | raw | blame | history
exampleSite/config.toml 2 ●●●●● patch | view | raw | blame | history
layouts/_default/single.html 6 ●●●●● patch | view | raw | blame | history
layouts/partials/comments/commento.html 4 ●●●● patch | view | raw | blame | history
README.md
@@ -19,7 +19,7 @@
- Post Thumbnails (optional)
- 100⁄100 Google Lighthouse score
- Google Analytics (optional)
- Comments powered by Disqus or Utteranc.es (optional)
- Comments powered by Disqus, Commento or Utteranc.es (optional)
- SimpleAnalytics (optional)
- Katex support (optional)
- Formspree Contact Form (optional)
@@ -236,6 +236,14 @@
- If you are using a strict CSP, you'll have to add the domain to it. 
- The script currently has no built-in integrity check, due to limitations of [Utterances](https://github.com/utterance/utterances/issues/40).
### Comments powered by Commento
You can use [Commento](https://commento.io/) as an alternative to Disqus. All you need to do is to configure a `CommentoURL`:
```toml
[params]
CommentoURL = "https://commento.example.com/js/commento.js"
```
### Disabling Comments Per Page
Comments can be disabled per page by setting `disableComments: true` on the pages [Front Matter](https://gohugo.io/content-management/front-matter/)
exampleSite/config.toml
@@ -40,6 +40,8 @@
# indexDateFormat = "Mon, Jan 2, 2006"
# listDateFormat = "Jan 2"
# singleDateFormat = "Mon, Jan 2, 2006"
# Commento Comments
# CommentoURL = "https://commento.example.com/js/commento.js"
[params.simpleAnalytics]
# enable = true
layouts/_default/single.html
@@ -46,6 +46,12 @@
                {{ partial "comments/utterances.html" . }}
            </div>
            {{- end -}}
            {{- if .Site.Params.CommentoURL -}}
            <div id="fb_comments_container">
                <h2>{{ i18n "comments" }}</h2>
                {{ partial "comments/commento.html" . }}
            </div>
            {{- end -}}
        {{ end }}
    </div>
layouts/partials/comments/commento.html
New file
@@ -0,0 +1,4 @@
<div id="commento"></div>
<script defer src="{{ .Site.Params.CommentoURL }}">
</script>
<noscript>Please enable JavaScript to load the comments.</noscript>