18 lines
672 B
HTML
18 lines
672 B
HTML
<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 }}'
|
|
|
|
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')
|
|
|
|
document.querySelector('main').appendChild(script)
|
|
</script>
|