fix: added empty judgment when rendering Gitalk

This commit is contained in:
XPoet 2021-01-06 18:48:30 +08:00
parent 63f8251177
commit 44ae2ba29c
1 changed files with 2 additions and 2 deletions

View File

@ -5,9 +5,9 @@
&& theme.comment.gitalk.github_id
&& theme.comment.gitalk.repository
) { %>
<div id="gitalk-container"></div>
<script <%= theme.pjax.enable === true ? 'data-pjax' : '' %>
src="//cdn.jsdelivr.net/npm/gitalk/dist/gitalk.min.js"></script>
<div id="gitalk-container"></div>
<script <%= theme.pjax.enable === true ? 'data-pjax' : '' %>>
function loadGitalk() {
@ -17,7 +17,7 @@
if (__gitalk__pathnameLength > __gitalk__pathnameMaxLength) {
__gitalk__pathname = __gitalk__pathname.substring(0, __gitalk__pathnameMaxLength - 3) + '...';
}
new Gitalk({
Gitalk && new Gitalk({
clientID: '<%= theme.comment.gitalk.client_id %>',
clientSecret: '<%= theme.comment.gitalk.client_secret %>',
repo: '<%= theme.comment.gitalk.repository %>',