Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Update valine comment system version #345

Merged
merged 4 commits into from
Jul 14, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion layout/_macro/post.swig
Original file line number Diff line number Diff line change
Expand Up @@ -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) %}
<span id="{{ url_for(post.path) }}" class="leancloud_visitors" data-flag-title="{{ post.title }}">
<span class="post-meta-divider">|</span>
<span class="post-meta-item-icon">
Expand Down
2 changes: 1 addition & 1 deletion layout/_third-party/analytics/lean-analytics.swig
Original file line number Diff line number Diff line change
@@ -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 #}
<script src="https://cdn1.lncld.net/static/js/av-core-mini-0.6.4.js"></script>
Expand Down
3 changes: 2 additions & 1 deletion layout/_third-party/comments/valine.swig
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
});
</script>
{% endif %}