Skip to content
This repository has been archived by the owner on Mar 9, 2022. It is now read-only.

Commit

Permalink
support twikoo comment system
Browse files Browse the repository at this point in the history
  • Loading branch information
OnlyFor authored and victor-pogor committed Aug 9, 2021
1 parent fb48140 commit 194044d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
16 changes: 16 additions & 0 deletions layouts/partials/comment.html
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,22 @@
Please enable JavaScript to view the comments powered by <a href="https://utteranc.es/">Utterances</a>.
</noscript>
{{- end -}}

{{- /* Twikoo Comment System */ -}}
{{- $twikoo := $comment.twikoo | default dict -}}
{{- if $twikoo.enable -}}
<div id="twikoo"></div>
<script src="{{ $twikoo.js }}"></script>
<script>
twikoo.init({
envId: 'https://xxxxx.vercel.app/',
el: '#twikoo',
// region: 'ap-guangzhou',
// path: 'window.location.pathname',
})
</script>
{{- end -}}

</div>
{{- end -}}

Expand Down
3 changes: 3 additions & 0 deletions layouts/posts/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ <h2 class="single-subtitle">{{ . }}</h2>
<i class="far fa-eye fa-fw"></i>&nbsp;<span class=leancloud-visitors-count></span>&nbsp;{{ T "views" }}
</span>&nbsp;
{{- end -}}
{{- if $comment.enable | and $comment.twikoo.enable -}}
<i class="far fa-eye fa-fw"></i>&nbsp;<span id="twikoo_visitors">0</span>&nbsp;{{ T "views" }}
{{- end -}}
</div>
</div>

Expand Down

0 comments on commit 194044d

Please sign in to comment.