hugo-theme-minima/layouts/partials/utterances.html

19 lines
672 B
HTML
Raw Normal View History

2021-11-12 08:47:28 +01:00
<script>
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 }}'
2021-11-12 08:47:28 +01:00
const script = document.createElement('script')
script.src = 'https://utteranc.es/client.js'
script.async = true
script.crossOrigin = 'anonymous'
script.setAttribute('repo', repo)
script.setAttribute('issue-term', issueTerm)
script.setAttribute('theme', theme)
script.setAttribute('label', label ? label : 'comment')
2021-11-12 08:47:28 +01:00
document.querySelector('main').appendChild(script)
</script>