add custom comment
This commit is contained in:
parent
5a2a7cc35a
commit
36ce31b835
3 changed files with 20 additions and 13 deletions
17
exampleSite/layouts/partials/comment.html
Normal file
17
exampleSite/layouts/partials/comment.html
Normal file
|
@ -0,0 +1,17 @@
|
|||
<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)
|
||||
script.setAttribute('label', 'comment')
|
||||
|
||||
document.querySelector('main').appendChild(script)
|
||||
</script>
|
|
@ -37,16 +37,6 @@
|
|||
{{ end }}
|
||||
|
||||
{{ if or .Params.comment (and .Site.Params.commentOnAllPosts (ne .Params.comment false)) }}
|
||||
{{ if eq .Site.Params.comment "disqus"}}
|
||||
{{ partial "disqus.html" . }}
|
||||
{{ end }}
|
||||
|
||||
{{ if eq .Site.Params.comment "ovo"}}
|
||||
{{ partial "ovo.html" . }}
|
||||
{{ end }}
|
||||
|
||||
{{ if eq .Site.Params.comment "utterances"}}
|
||||
{{ partial "utterances.html" . }}
|
||||
{{ end }}
|
||||
{{ partial "comment.html" . }}
|
||||
{{ end }}
|
||||
{{ end }}
|
0
layouts/partials/comment.html
Normal file
0
layouts/partials/comment.html
Normal file
Loading…
Add table
Add a link
Reference in a new issue