comment
This commit is contained in:
@ -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' %}
|
||||
|
Reference in New Issue
Block a user