Skip to content

Commit

Permalink
[Add] add valine comment system
Browse files Browse the repository at this point in the history
  • Loading branch information
lloyar committed Nov 29, 2018
1 parent 23254a9 commit 9c30d76
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
6 changes: 6 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,12 @@ comments:
admin: # GitHub repo owner and collaborators, only these guys can initialize GitHub issues, IT IS A LIST.
# - your GitHub Id

## Valine
# please refer to https://valine.js.org/en/index.html for more info.
custom:
API_ID : # LeanCloud App id
API_Key : # LeanCloud App key
placeholder: Just Go Go. # Prompt information

## => Pageview
##############################
Expand Down
22 changes: 22 additions & 0 deletions _includes/comments-providers/custom.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

{%- if page.key and
site.comments.custom.API_ID and
site.comments.custom.API_Key and
site.comments.custom.placeholder -%}

<div id="vcomments"></div>
<!--Leancloud 操作库:-->
<script src="//cdn1.lncld.net/static/js/3.0.4/av-min.js"></script>
<!--Valine 的核心代码库:-->
<script src='//unpkg.com/valine/dist/Valine.min.js'></script>
<script>
new Valine({
el: '#vcomments',
appId: '{{ site.comments.custom.API_ID }}',
appKey: '{{ site.comments.custom.API_Key }}',
verify: true,
placeholder: '{{ site.comments.custom.placeholder }}'
})
</script>

{%- endif -%}

0 comments on commit 9c30d76

Please sign in to comment.