Skip to content
Closed
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 @@ -389,6 +389,19 @@ valine:
# You can get your uid from https://livere.com/insight/myCode (General web site)
#livere_uid: your uid

# Gitalk comment support.
# Before using this you need to create a GitHub OAuth applicant.
# See https://github.com/gitalk/gitalk.
gitalk:
enable: false
clientID:
clientSecret:
repo: # Your repo name.
owner: # Your username.
admin: # Your username and other admins' username, support multiple admins split with comma, e.g. foo,bar.
pagerDirection: first # Start with the first comment.


# Gitment
# Introduction: https://imsun.net/posts/gitment-introduction/
# You can get your Github ID from https://api.github.com/users/<Github username>
Expand Down
5 changes: 5 additions & 0 deletions layout/_partials/comments.swig
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@
{% endif %}
</div>

{% elseif theme.gitalk.enable %}
<div class="comments" id="comments">
<div id="gitalk-container"></div>
</div>

{% elseif theme.valine.appid and theme.valine.appkey %}
<div class="comments" id="comments">
</div>
Expand Down
21 changes: 21 additions & 0 deletions layout/_third-party/comments/gitalk.swig
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{% if not (theme.duoshuo and theme.duoshuo.shortname) and not theme.duoshuo_shortname %}
{% if theme.gitalk.enable %}
{% if page.comments %}
<link rel="stylesheet" href="https://unpkg.com/gitalk/dist/gitalk.css">
<script src="https://unpkg.com/gitalk/dist/gitalk.min.js"></script>
<script type="text/javascript">
const gitalk = new Gitalk({
clientID: '{{ theme.gitalk.clientID }}',
clientSecret: '{{ theme.gitalk.clientSecret }}',
repo: '{{ theme.gitalk.repo }}',
owner: '{{ theme.gitalk.owner }}',
admin: '{{ theme.gitalk.admin}}'.split(','),
pagerDirection: '{{theme.gitalk.pagerDirection}}',
// facebook-like distraction free mode
distractionFreeMode: false
})
gitalk.render('gitalk-container')
</script>
{% endif %}
{% endif %}
{% 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 @@ -5,4 +5,5 @@
{% include 'livere.swig' %}
{% include 'changyan.swig' %}
{% include 'gitment.swig' %}
{% include 'gitalk.swig' %}
{% include 'valine.swig' %}