Added support for comment label customization
This commit is contained in:
parent
ef4d32b949
commit
b4289bcbd4
2 changed files with 3 additions and 1 deletions
|
@ -62,6 +62,7 @@ shortname = "hugo-minima"
|
||||||
[params.utterances]
|
[params.utterances]
|
||||||
repo = "mivinci/hugo-theme-minima"
|
repo = "mivinci/hugo-theme-minima"
|
||||||
issueTerm = "pathname"
|
issueTerm = "pathname"
|
||||||
|
label = "comment"
|
||||||
|
|
||||||
# **deprecated**
|
# **deprecated**
|
||||||
# OvO is a comment plugin written by the author of Minima.
|
# OvO is a comment plugin written by the author of Minima.
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
const repo = '{{ .Site.Params.utterances.repo }}'
|
const repo = '{{ .Site.Params.utterances.repo }}'
|
||||||
const issueTerm = '{{ .Site.Params.utterances.issueTerm }}'
|
const issueTerm = '{{ .Site.Params.utterances.issueTerm }}'
|
||||||
const theme = localStorage.theme ? `github-${localStorage.theme}` : 'preferred-color-scheme';
|
const theme = localStorage.theme ? `github-${localStorage.theme}` : 'preferred-color-scheme';
|
||||||
|
const label = '{{ .Site.Params.utterances.label }}'
|
||||||
|
|
||||||
const script = document.createElement('script')
|
const script = document.createElement('script')
|
||||||
script.src = 'https://utteranc.es/client.js'
|
script.src = 'https://utteranc.es/client.js'
|
||||||
|
@ -11,7 +12,7 @@
|
||||||
script.setAttribute('repo', repo)
|
script.setAttribute('repo', repo)
|
||||||
script.setAttribute('issue-term', issueTerm)
|
script.setAttribute('issue-term', issueTerm)
|
||||||
script.setAttribute('theme', theme)
|
script.setAttribute('theme', theme)
|
||||||
script.setAttribute('label', 'comment')
|
script.setAttribute('label', label ? label : 'comment')
|
||||||
|
|
||||||
document.querySelector('main').appendChild(script)
|
document.querySelector('main').appendChild(script)
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in a new issue