diff --git a/_config.yml b/_config.yml index 3e258b3269..e4775d96bd 100644 --- a/_config.yml +++ b/_config.yml @@ -494,7 +494,7 @@ changyan: # You can get your appid and appkey from https://leancloud.cn # more info please open https://valine.js.org valine: - enable: false + 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. appid: # your leancloud application appid appkey: # your leancloud application appkey notify: false # mail notifier , https://github.com/xCss/Valine/wiki @@ -503,6 +503,7 @@ valine: avatar: mm # gravatar style guest_info: nick,mail,link # custom comment header pageSize: 10 # pagination size + 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 # Support for youyan comments system. diff --git a/layout/_macro/post.swig b/layout/_macro/post.swig index 96530b51d7..81cc569867 100644 --- a/layout/_macro/post.swig +++ b/layout/_macro/post.swig @@ -212,7 +212,7 @@ {% endif %} {# LeanCould PageView #} - {% if theme.leancloud_visitors.enable %} + {% if theme.leancloud_visitors.enable or (theme.valine.enable and theme.valine.appid and theme.valine.appkey and theme.valine.visitor) %} | diff --git a/layout/_third-party/analytics/lean-analytics.swig b/layout/_third-party/analytics/lean-analytics.swig index 46496471dc..9907195c93 100644 --- a/layout/_third-party/analytics/lean-analytics.swig +++ b/layout/_third-party/analytics/lean-analytics.swig @@ -1,4 +1,4 @@ -{% if theme.leancloud_visitors.enable %} +{% if theme.leancloud_visitors.enable and !theme.valine.visitor %} {# custom analytics part create by xiamo; edited by LEAFERx #} diff --git a/layout/_third-party/comments/valine.swig b/layout/_third-party/comments/valine.swig index a5d09eec84..5049565f9d 100644 --- a/layout/_third-party/comments/valine.swig +++ b/layout/_third-party/comments/valine.swig @@ -20,8 +20,9 @@ appKey: '{{ theme.valine.appkey }}', placeholder: '{{ theme.valine.placeholder }}', avatar:'{{ theme.valine.avatar }}', - guest_info:guest, + meta:guest, pageSize:'{{ theme.valine.pageSize }}' || 10, + visitor: {{ theme.valine.visitor }} }); {% endif %}