diff options
author | amazingrise <8315221+AmazingRise@users.noreply.github.com> | 2021-04-14 07:06:13 +0300 |
---|---|---|
committer | amazingrise <8315221+AmazingRise@users.noreply.github.com> | 2021-04-14 07:06:13 +0300 |
commit | e3e2bceeb2f4e5d668d69fc79f4873d4e09cfa76 (patch) | |
tree | f952c750927845f12c6f558d040ba783d06936c9 | |
parent | db8f3be61a127212c89391375cf8f4509c9d2ecd (diff) | |
parent | 5e889733d031db8dfd1f775e56eb48b63a106be7 (diff) |
Merge branch 'twikoo'
-rw-r--r-- | layouts/partials/comment.html | 5 | ||||
-rw-r--r-- | layouts/partials/head.html | 6 | ||||
-rw-r--r-- | layouts/partials/journal.html | 3 |
3 files changed, 13 insertions, 1 deletions
diff --git a/layouts/partials/comment.html b/layouts/partials/comment.html index d73a9a0..e4699fd 100644 --- a/layouts/partials/comment.html +++ b/layouts/partials/comment.html @@ -20,3 +20,8 @@ <noscript>{{ i18n "comments_activate_js" }}</noscript> </div> {{ end }} + +{{ if .Site.Params.enableTwikoo }} +<div id="tcomment"></div> +{{ end }} +
\ No newline at end of file diff --git a/layouts/partials/head.html b/layouts/partials/head.html index bf58d73..91b9812 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -113,8 +113,12 @@ $( <script src='https://unpkg.com/valine@1.4.14/dist/Valine.min.js'></script> {{ end }} -{{ if .Site.Params.disqusShortname }} +{{ if and (.Site.Params.disqusShortname) (.IsPage) }} <script src="https://cdn.jsdelivr.net/npm/vue-disqus@3/dist/vue-disqus.js"></script> {{ end }} +{{ if and (.Site.Params.enableTwikoo) (.IsPage) }} +<script src="https://cdn.jsdelivr.net/npm/twikoo@1.3.0/dist/twikoo.all.min.js"></script> +{{ end }} + </head> diff --git a/layouts/partials/journal.html b/layouts/partials/journal.html index 2f89c96..34779d0 100644 --- a/layouts/partials/journal.html +++ b/layouts/partials/journal.html @@ -101,6 +101,9 @@ app = new Vue({ recordIP: true, }) {{ end }} + {{ if and (.Site.Params.enableTwikoo) (.IsPage) }} + twikoo.init({ envId: {{.Site.Params.twikooEnvId}}, el: '#tcomment' }); + {{ end }} }, destroyed() { window.removeEventListener('scroll', this.handleScroll); |