Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/AmazingRise/hugo-theme-diary.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoramazingrise <8315221+AmazingRise@users.noreply.github.com>2021-04-03 07:56:22 +0300
committeramazingrise <8315221+AmazingRise@users.noreply.github.com>2021-04-03 07:56:22 +0300
commit5621921c778a0c3790cb486633513af74d5bd5f7 (patch)
tree22648c6275c397326f0a7c2358d38cca4bae090a
parentf612ddd985c218bf056db32412477acf65f63d6b (diff)
Add twikoo support.
-rw-r--r--layouts/partials/comment.html5
-rw-r--r--layouts/partials/head.html6
-rw-r--r--layouts/partials/journal.html3
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..c2ee7d4 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);