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

github.com/xianmin/hugo-theme-jane.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHorace_linux <ybwhos@gmail.com>2019-08-24 08:06:50 +0300
committerHorace_linux <ybwhos@gmail.com>2019-08-24 08:06:50 +0300
commite9ae6659fd98be8403c13c90bfd67c1b3dcdc471 (patch)
tree24bd9972b04324099033f588878c8ea5e71d3cd4
parente61a7c6d6c344b10e16ca889aa26bab78e9dddb1 (diff)
add valine in comments and full-config
-rw-r--r--exampleSite/full-config.toml12
-rw-r--r--layouts/partials/comments.html31
2 files changed, 42 insertions, 1 deletions
diff --git a/exampleSite/full-config.toml b/exampleSite/full-config.toml
index 2705ce4..e41a92d 100644
--- a/exampleSite/full-config.toml
+++ b/exampleSite/full-config.toml
@@ -147,6 +147,18 @@ defaultContentLanguage = "en" # Default language to use
[params.livere] #LiveRe comment. see https://www.livere.com/
uid = ""
+ # Valine.
+ # You can get your appid and appkey from https://leancloud.cn
+ # more info please open https://valine.js.org
+ [params.valine]
+ enable = false
+ appId = ''
+ appKey = ''
+ notify = false # If you are using valine-admin to notify users, do NOT enable this. https://github.com/xCss/Valine/wiki
+ verify = false # Verification code
+ avatar = 'mm'
+ placeholder = ''
+
[params.search.google] # google custom search, see https://cse.google.com
enable = false
id = "002186711602136249422:q1gkomof_em"
diff --git a/layouts/partials/comments.html b/layouts/partials/comments.html
index 86fee0d..2b702e3 100644
--- a/layouts/partials/comments.html
+++ b/layouts/partials/comments.html
@@ -118,6 +118,35 @@
<a href="https://www.livere.com">comments powered by LiveRe.</a>
</noscript>
</div>
- {{- end }}
+ {{- end }}
+
+ <!-- valine -->
+ {{- if .Site.Params.valine.enable -}}
+ <div id="comments"></div>
+ <script src="//cdn1.lncld.net/static/js/3.0.4/av-min.js"></script>
+ <script src='//unpkg.com/valine/dist/Valine.min.js'></script>
+ <script>
+ if(window.location.hash){
+ var checkExist = setInterval(function() {
+ if ($(window.location.hash).length) {
+ $('html, body').animate({scrollTop: $(window.location.hash).offset().top-90}, 700);
+ clearInterval(checkExist);
+ }
+ }, 10);
+ }
+ </script>
+ <script type="text/javascript">
+ new Valine({
+ el: '#comments' ,
+ appId: '{{ .Site.Params.valine.appId }}',
+ appKey: '{{ .Site.Params.valine.appKey }}',
+ notify: {{ .Site.Params.valine.notify }},
+ verify: {{ .Site.Params.valine.verify }},
+ avatar:'{{ .Site.Params.valine.avatar }}',
+ placeholder: '{{ .Site.Params.valine.placeholder }}',
+ visitor: {{ false }}
+ });
+ </script>
+ {{- end }}
{{- end }}