Skip to content

Commit 7d17575

Browse files
xCssAlex LEE
authored andcommitted
Update valine comment system version (#345)
* Update valine comment system version * Update valine visitor annotation * Update valine instruction
1 parent ec18888 commit 7d17575

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

_config.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,7 @@ changyan:
494494
# You can get your appid and appkey from https://leancloud.cn
495495
# more info please open https://valine.js.org
496496
valine:
497-
enable: false
497+
enable: false # When enable is set to be true, leancloud_visitors is recommended to be closed for the re-initialization problem within different leancloud adk version.
498498
appid: # your leancloud application appid
499499
appkey: # your leancloud application appkey
500500
notify: false # mail notifier , https://github.com/xCss/Valine/wiki
@@ -503,6 +503,7 @@ valine:
503503
avatar: mm # gravatar style
504504
guest_info: nick,mail,link # custom comment header
505505
pageSize: 10 # pagination size
506+
visitor: false # leancloud-counter-security is not supported for now. When visitor is set to be true, appid and appkey are recommended to be the same as leancloud_visitors' for counter compatibility. Article reading statistic https://valine.js.org/visitor.html
506507

507508

508509
# Support for youyan comments system.

layout/_macro/post.swig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@
212212
{% endif %}
213213

214214
{# LeanCould PageView #}
215-
{% if theme.leancloud_visitors.enable %}
215+
{% if theme.leancloud_visitors.enable or (theme.valine.enable and theme.valine.appid and theme.valine.appkey and theme.valine.visitor) %}
216216
<span id="{{ url_for(post.path) }}" class="leancloud_visitors" data-flag-title="{{ post.title }}">
217217
<span class="post-meta-divider">|</span>
218218
<span class="post-meta-item-icon">

layout/_third-party/analytics/lean-analytics.swig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{% if theme.leancloud_visitors.enable %}
1+
{% if theme.leancloud_visitors.enable and !theme.valine.visitor %}
22

33
{# custom analytics part create by xiamo; edited by LEAFERx #}
44
<script src="https://cdn1.lncld.net/static/js/av-core-mini-0.6.4.js"></script>

layout/_third-party/comments/valine.swig

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@
2020
appKey: '{{ theme.valine.appkey }}',
2121
placeholder: '{{ theme.valine.placeholder }}',
2222
avatar:'{{ theme.valine.avatar }}',
23-
guest_info:guest,
23+
meta:guest,
2424
pageSize:'{{ theme.valine.pageSize }}' || 10,
25+
visitor: {{ theme.valine.visitor }}
2526
});
2627
</script>
2728
{% endif %}

0 commit comments

Comments
 (0)