Merge pull request #76 from leonhfr/feature/utterances

uteranc.es support
This commit is contained in:
Dmitry Kolosov 2021-01-23 15:51:51 +03:00 committed by GitHub
commit 21306c4ab5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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
- Google Analytics
- Disqus
- Utteranc.es
- RSS feeds
- Translations (en, ru, fr, pl)
- Custom CSS/JS
@ -72,6 +73,11 @@ params:
paginationSinglePost: true
style: light-without-switcher
readMore: false
# utteranc.es support
utterancesRepo: "" # mandatory
utterancesTheme: "" # optional
utterancesIssue: "" # optional
utterancesLabel: "" # optional
webmentions:
login: hugo-theme-anubis
pingback: true

View File

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

View File

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

View File

@ -25,4 +25,8 @@
{{ template "_internal/disqus.html" . }}
{{ end }}
{{ if .Site.Params.UtterancesRepo }}
{{ partial "utterances.html" . }}
{{ 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>