Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Feature:Add Valine comment system support #1811

Merged
merged 3 commits into from
Aug 13, 2017
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
13 changes: 13 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,18 @@ changyan:
appid:
appkey:


# Valine.
# You can get your appid and appkey from https://leancloud.cn
# more info please open https://github.com/xCss/Valine
valine:
enable: false
appid: # your leancloud application appid
appkey: # your leancloud application appkey
notify: false # mail notifier , https://github.com/xCss/Valine/wiki
verify: false # Verification code
placeholder: Comment input placeholder

# Support for youyan comments system.
# You can get your uid from http://www.uyan.cc
#youyan_uid: your uid
Expand Down Expand Up @@ -390,6 +402,7 @@ duoshuo_info:
#admin_nickname: Author



# Facebook SDK Support.
# https://github.com/iissnan/hexo-theme-next/pull/410
facebook_sdk:
Expand Down
2 changes: 2 additions & 0 deletions layout/_partials/comments.swig
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
<div id="lv-container" data-id="city" data-uid="{{ theme.livere_uid }}"></div>
{% elseif theme.changyan.appid and theme.changyan.appkey %}
<div id="SOHUCS"></div>
{% elseif theme.valine.appid and theme.valine.appkey %}
<div id="vcomments"></div>
{% endif %}
</div>
{% endif %}
1 change: 1 addition & 0 deletions layout/_third-party/comments/index.swig
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
{% include 'youyan.swig' %}
{% include 'livere.swig' %}
{% include 'changyan.swig' %}
{% include 'valine.swig' %}
16 changes: 16 additions & 0 deletions layout/_third-party/comments/valine.swig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{% if theme.valine.enable and theme.valine.appid and theme.valine.appkey %}

<script src="//cdn1.lncld.net/static/js/3.0.4/av-min.js"></script>
<script src="//cdn.jsdelivr.net/npm/valine@1.1.4/dist/Valine.min.js"></script>
<script type="text/javascript">
new Valine({
av: AV,
el: '#vcomments' ,
verify: {{ theme.valine.verify }},
notify: {{ theme.valine.notify }},
app_id: '{{ theme.valine.appid }}',
app_key: '{{ theme.valine.appkey }}',
placeholder: '{{ theme.valine.placeholder }}'
});
</script>
{% endif %}