[FEATURE] Utteranc.es support

This commit is contained in:
Leon 2021-01-17 17:16:45 +01:00
parent 723c94d0d4
commit c86bdecb0a
5 changed files with 33 additions and 0 deletions

View File

@ -14,6 +14,7 @@ Anubis is a simple minimalist theme for [Hugo blog engine](https://gohugo.io/).
- Mobile support - Mobile support
- Google Analytics - Google Analytics
- Disqus - Disqus
- Utteranc.es
- RSS feeds - RSS feeds
- Translations (en, ru, fr, pl) - Translations (en, ru, fr, pl)
- Custom CSS/JS - Custom CSS/JS
@ -70,6 +71,11 @@ params:
paginationSinglePost: true paginationSinglePost: true
style: light-without-switcher style: light-without-switcher
readMore: false readMore: false
# utteranc.es support
utterancesRepo: "" # mandatory
utterancesTheme: "" # optional
utterancesIssue: "" # optional
utterancesLabel: "" # optional
webmentions: webmentions:
login: hugo-theme-anubis login: hugo-theme-anubis
pingback: true pingback: true

View File

@ -18,6 +18,12 @@ googleAnalytics = ""
style = "light-without-switcher" style = "light-without-switcher"
readMore = false readMore = false
# utteranc.es support
utterancesRepo = "" # mandatory
utterancesTheme = "" # optional
utterancesIssue = "" # optional
utterancesLabel = "" # optional
[menu] [menu]
[[menu.main]] [[menu.main]]

View File

@ -19,6 +19,12 @@ googleAnalytics = ""
style = "light-without-switcher" style = "light-without-switcher"
readMore = false readMore = false
# utteranc.es support
utterancesRepo = "" # mandatory
utterancesTheme = "" # optional
utterancesIssue = "" # optional
utterancesLabel = "" # optional
[languages.en] [languages.en]
languageName = "English" languageName = "English"

View File

@ -25,4 +25,8 @@
{{ template "_internal/disqus.html" . }} {{ template "_internal/disqus.html" . }}
{{ end }} {{ end }}
{{ if .Site.Params.UtterancesRepo }}
{{ partial "utterances.html" . }}
{{ end }}
{{ end }} {{ end }}

View File

@ -0,0 +1,11 @@
{{ $theme := .Site.Params.UtterancesTheme | default "github-light" }}
{{ $label := .Site.Params.UtterancesLabel | default "" }}
{{ $issue := .Site.Params.UtterancesIssue | default "url" }}
<script src="https://utteranc.es/client.js"
repo="{{- .Site.Params.UtterancesRepo -}}"
theme="{{ $theme }}"
label="{{ $label }}"
issue-term="{{ $issue }}"
crossorigin="anonymous"
async>
</script>