mirror of
https://github.com/CaiJimmy/hugo-theme-stack.git
synced 2024-11-27 12:03:49 +01:00
feat(comments): add utterances support
closes https://github.com/CaiJimmy/hugo-theme-stack/issues/21
This commit is contained in:
parent
fa0f8fa365
commit
9fcdedf042
2 changed files with 22 additions and 2 deletions
|
@ -28,8 +28,12 @@ DefaultContentLanguage = "en" # Theme i18n support
|
|||
default = "Licensed under CC BY-NC-SA 4.0"
|
||||
[params.comments]
|
||||
enabled = true
|
||||
# Only Disqus is available so far
|
||||
provider = "disqus"
|
||||
provider = "disqus" # Available: disqus, utterances
|
||||
[params.comments.utterances]
|
||||
repo = ""
|
||||
issueTerm = "pathname"
|
||||
label = "" # Optional
|
||||
theme="preferred-color-scheme"
|
||||
[params.widgets]
|
||||
enabled = ['archives', 'tag-cloud']
|
||||
[params.widgets.archives]
|
||||
|
|
16
layouts/partials/comments/provider/utterances.html
Normal file
16
layouts/partials/comments/provider/utterances.html
Normal file
|
@ -0,0 +1,16 @@
|
|||
<script src="https://utteranc.es/client.js"
|
||||
repo="{{ .Site.Params.comments.utterances.repo }}"
|
||||
issue-term="{{ .Site.Params.comments.utterances.issueTerm }}"
|
||||
theme="{{ .Site.Params.comments.utterances.theme }}"
|
||||
{{ with .Site.Params.comments.utterances.label }}
|
||||
label="{{ . }}"
|
||||
{{ end }}
|
||||
crossorigin="anonymous"
|
||||
async>
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.utterances {
|
||||
max-width: unset;
|
||||
}
|
||||
</style>
|
Loading…
Reference in a new issue