comment
This commit is contained in:
parent
d2982e6969
commit
e3763f07c1
@ -408,7 +408,7 @@ valine:
|
||||
# Introduction: https://imsun.net/posts/gitment-introduction/
|
||||
# You can get your Github ID from https://api.github.com/users/<Github username>
|
||||
gitment:
|
||||
enable: true
|
||||
enable: false
|
||||
mint: true # RECOMMEND, A mint on Gitment, to support count, language and proxy_gateway
|
||||
count: true # Show comments count in post meta area
|
||||
lazy: false # Comments lazy loading with a button
|
||||
@ -421,6 +421,15 @@ gitment:
|
||||
proxy_gateway: # Address of api proxy, See: https://github.com/aimingoo/intersect
|
||||
redirect_protocol: # Protocol of redirect_uri with force_redirect_protocol when mint enabled
|
||||
|
||||
gitalk:
|
||||
enable: true
|
||||
github_user: Cool-Y
|
||||
github_repo: gitment-comments
|
||||
client_id: 180955a2c3ae3d966d9a
|
||||
client_secret: 1c5db4da72df5e6fc318d12afe5f4406f7c54343
|
||||
admin: Cool-Y
|
||||
distractionFreeMode: true
|
||||
|
||||
# Baidu Share
|
||||
# Available value:
|
||||
# button | slide
|
||||
|
@ -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>
|
||||
|
30
themes/next/layout/_third-party/comments/gitalk.swig
vendored
Normal file
30
themes/next/layout/_third-party/comments/gitalk.swig
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
{% if not (theme.duoshuo and theme.duoshuo.shortname) and not theme.duoshuo_shortname %}
|
||||
{% if theme.gitalk.enable and theme.gitalk.client_id %}
|
||||
<!-- LOCAL: You can save these files to your site and update links -->
|
||||
{% set CommentsClass = "Gitalk" %}
|
||||
<link rel="stylesheet" href="https://unpkg.com/gitalk/dist/gitalk.css">
|
||||
<script src="https://unpkg.com/gitalk/dist/gitalk.min.js"></script>
|
||||
<!-- END LOCAL -->
|
||||
|
||||
{% if page.comments %}
|
||||
<script type="text/javascript">
|
||||
function renderGitalk(){
|
||||
var gitalk = new {{CommentsClass}}({
|
||||
owner: '{{ theme.gitalk.github_user }}',
|
||||
repo: '{{ theme.gitalk.github_repo }}',
|
||||
clientID: '{{ theme.gitalk.client_id }}',
|
||||
clientSecret: '{{ theme.gitalk.client_secret }}',
|
||||
admin: '{{ theme.gitalk.admin }}',
|
||||
id: decodeURI(location.pathname),
|
||||
{% if theme.gitalk.distractionFreeMode %}
|
||||
distractionFreeMode: '{{ theme.gitalk.distractionFreeMode }}'
|
||||
{% endif %}
|
||||
});
|
||||
gitalk.render('gitalk-container');
|
||||
}
|
||||
renderGitalk();
|
||||
</script>
|
||||
{% endif %}
|
||||
|
||||
{% endif %}
|
||||
{% endif %}
|
@ -6,3 +6,4 @@
|
||||
{% include 'changyan.swig' %}
|
||||
{% include 'gitment.swig' %}
|
||||
{% include 'valine.swig' %}
|
||||
{% include 'gitalk.swig' %}
|
||||
|
Loading…
Reference in New Issue
Block a user