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

18 lines
602 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 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)
2021-11-12 08:58:35 +01:00
script.setAttribute('label', 'comment')
2021-11-12 08:47:28 +01:00
document.querySelector('main').appendChild(script)
</script>