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

Add waline support #319

Merged
merged 1 commit into from
Oct 25, 2021
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
5 changes: 5 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,11 @@ comment:
valine_appId:
valine_appKey:
valine_placeHolder:
# Waline site: https://waline.js.org/
waline_serverURL:
waline_placeHolder:
waline_avatar:
waline_login:
# gitalk site: https://github.com/gitalk/gitalk/
# Value 'true' is recommended for gitalk_pathname_id setting
gitalk_client_id:
Expand Down
13 changes: 13 additions & 0 deletions layout/_partial/comment/waline.ejs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<% if(theme.comment && theme.comment.waline_serverURL) { %>
<script src="//cdn.jsdelivr.net/npm/@waline/client"></script>
<div id="comment"></div>
<script>
Waline({
el: '#comment' ,
serverURL: "<%- theme.comment.waline_serverURL %>",
placeholder: "<%- theme.comment.waline_placeHolder %>",
avatar: "<%- theme.comment.waline_avatar %>",
login: "<%- theme.comment.waline_login %>"
});
</script>
<% } %>
1 change: 1 addition & 0 deletions layout/post.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
<%- partial('_partial/comment/youyan') %>
<%- partial('_partial/comment/custom') %>
<%- partial('_partial/comment/valine') %>
<%- partial('_partial/comment/waline') %>
</div>
<% } %>
<!-- timeliness note -->
Expand Down