Added support for comment label customization

This commit is contained in:
Memory Clutter 2022-11-05 15:43:57 +03:00
parent ef4d32b949
commit b4289bcbd4
2 changed files with 3 additions and 1 deletions

View file

@ -2,6 +2,7 @@
const repo = '{{ .Site.Params.utterances.repo }}'
const issueTerm = '{{ .Site.Params.utterances.issueTerm }}'
const theme = localStorage.theme ? `github-${localStorage.theme}` : 'preferred-color-scheme';
const label = '{{ .Site.Params.utterances.label }}'
const script = document.createElement('script')
script.src = 'https://utteranc.es/client.js'
@ -11,7 +12,7 @@
script.setAttribute('repo', repo)
script.setAttribute('issue-term', issueTerm)
script.setAttribute('theme', theme)
script.setAttribute('label', 'comment')
script.setAttribute('label', label ? label : 'comment')
document.querySelector('main').appendChild(script)
</script>