fix(comment): disable gitment on index page

pull/312/merge 0.5.0
ppoffice 2018-10-16 21:47:31 -04:00
parent e11120f479
commit a3a971e774
1 changed files with 11 additions and 11 deletions

View File

@ -2,6 +2,7 @@
<link rel="stylesheet" href="https://imsun.github.io/gitment/style/default.css"> <link rel="stylesheet" href="https://imsun.github.io/gitment/style/default.css">
<script src="https://imsun.github.io/gitment/dist/gitment.browser.js"></script> <script src="https://imsun.github.io/gitment/dist/gitment.browser.js"></script>
<script> <script>
if (document.getElementById('comments')) {
var gitment = new Gitment({ var gitment = new Gitment({
owner: '<%= theme.comment.gitment.owner %>', owner: '<%= theme.comment.gitment.owner %>',
repo: '<%= theme.comment.gitment.repo %>', repo: '<%= theme.comment.gitment.repo %>',
@ -10,8 +11,7 @@
client_secret: '<%= theme.comment.gitment.client_secret %>', client_secret: '<%= theme.comment.gitment.client_secret %>',
}, },
}) })
gitment.render('commentContainer') gitment.render('comments')
}
</script> </script>
<% } else { %>
<div id="commentContainer"></div>
<% } %> <% } %>