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>2020-02-14 13:55:00 +0300
committeramazingrise <8315221+AmazingRise@users.noreply.github.com>2020-02-14 13:55:00 +0300
commitfdaf6145cbbc4573a87e51b492e4893722b8fe73 (patch)
treeda27583d014adfc272fa9a14643636ab1f49011c /layouts
parent5812392737ce6204f49b6cfe623c5a846ac872c1 (diff)
Add Valine comment.
Diffstat (limited to 'layouts')
-rw-r--r--layouts/partials/comment.html4
-rw-r--r--layouts/partials/head.html16
2 files changed, 20 insertions, 0 deletions
diff --git a/layouts/partials/comment.html b/layouts/partials/comment.html
index 3c90589..121c9ad 100644
--- a/layouts/partials/comment.html
+++ b/layouts/partials/comment.html
@@ -8,6 +8,10 @@
<div id="gitalk-container"></div>
{{ end }}
+{{ if .Site.Params.enableValine }}
+<div id="vcomments"></div>
+{{ end }}
+
{{ if .Site.Params.livereId }}
<div id="lv-container" data-id="city" data-uid={{.Site.Params.livereId}}>
<noscript>Please activate JavaScript to use Livere Comment.</noscript>
diff --git a/layouts/partials/head.html b/layouts/partials/head.html
index 5c46c24..99bb311 100644
--- a/layouts/partials/head.html
+++ b/layouts/partials/head.html
@@ -58,6 +58,7 @@
}
</script>
{{ end }}
+
{{ if and (.Site.Params.livereId) (.IsPage) }}
<script type="text/javascript">
$(
@@ -74,4 +75,19 @@ $(
})(document, 'script'));
</script>
{{ end }}
+
+{{ if and (.Site.Params.enableValine) (.IsPage) }}
+<script src='//unpkg.com/valine/dist/Valine.min.js'></script>
+<script>
+ $(new Valine({
+ {{ if .Site.Params.Valine.avator }}
+ avator: '{{.Site.Params.Valine.avator}}',
+ {{ end }}
+ el: '#vcomments',
+ appId: '{{ .Site.Params.Valine.appId }}',
+ appKey: '{{ .Site.Params.Valine.appKey }}'
+ }));
+</script>
+{{ end }}
+
</head> \ No newline at end of file