diff options
author | alicewish <anywaywillgo@gmail.com> | 2019-05-25 18:50:03 +0800 |
---|---|---|
committer | olOwOlo <26087907+olOwOlo@users.noreply.github.com> | 2019-05-25 18:50:03 +0800 |
commit | d8a7dab116ee3b63155454bacda87538bbd6351d (patch) | |
tree | 4d7b586173b713d3b844a348e46f6df233f97da6 /layouts/partials | |
parent | cd7f705800097659601828bc63bf3f1ea8d19033 (diff) |
feat(comment): Valine Support (#155)
Closes #95
Diffstat (limited to 'layouts/partials')
-rw-r--r-- | layouts/partials/comments.html | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/layouts/partials/comments.html b/layouts/partials/comments.html index e7d6f6d..af5e0c7 100644 --- a/layouts/partials/comments.html +++ b/layouts/partials/comments.html @@ -95,5 +95,32 @@ </script> <noscript>Please enable JavaScript to view the <a href="https://github.com/gitalk/gitalk">comments powered by gitalk.</a></noscript> {{- end }} + + <!-- valine --> + {{- if .Site.Params.valine.enable -}} + <!-- id 将作为查询条件 --> + {{- if .Site.Params.valine.visitor -}} + <span id="{{ .URL | relURL }}" class="leancloud_visitors" data-flag-title="{{ .Title }}"> + <span class="post-meta-item-text">文章阅读量 </span> + <span class="leancloud-visitors-count">0</span> + <p></p> + </span> + {{- end }} + <div id="vcomments"></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 type="text/javascript"> + new Valine({ + el: '#vcomments' , + 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: {{ .Site.Params.valine.visitor }} + }); + </script> + {{- end }} {{- end }} |