100% support of utterances
This commit is contained in:
parent
6d38283d7d
commit
74d14b51a1
8 changed files with 76 additions and 23 deletions
16
layouts/partials/utterances.html
Normal file
16
layouts/partials/utterances.html
Normal file
|
@ -0,0 +1,16 @@
|
|||
<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)
|
||||
|
||||
document.querySelector('main').appendChild(script)
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue