Merge pull request #1 from liuchang0812/add-gittalk

add gittalk
This commit is contained in:
Chang Liu 2021-11-11 20:36:16 +08:00 committed by GitHub
commit c43c5746ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 2 deletions

View File

@ -51,9 +51,7 @@
{{- end }}
</footer>
{{- if (.Param "comments") }}
{{- partial "comments.html" . }}
{{- end }}
</article>
{{- end }}{{/* end main */}}

View File

@ -1,3 +1,17 @@
{{- /* Comments area start */ -}}
{{- /* to add comments read => https://gohugo.io/content-management/comments/ */ -}}
<div id="gitalk-container"></div>
<script>
const gitalk = new Gitalk({
clientID: '402f41759b3537b6c752',
clientSecret: 'd9558424431bfc3ee18d4b6c6ce7594ef682a701',
repo: 'liuchang0812.github.io', // The repository of store comments,
owner: 'liuchang0812',
admin: ['liuchang0812'],
id: location.pathname, // Ensure uniqueness and length less than 50
distractionFreeMode: false // Facebook-like distraction free mode
})
gitalk.render('gitalk-container')
</script>
{{- /* Comments area end */ -}}

View File

@ -115,6 +115,9 @@
<link rel="alternate" hreflang="{{ .Lang }}" href="{{ .Permalink }}" />
{{ end -}}
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/gitalk@1/dist/gitalk.css">
<script src="https://cdn.jsdelivr.net/npm/gitalk@1/dist/gitalk.min.js"></script>
<noscript>
<style>
#theme-toggle,