Skip to content

Commit a3a971e

Browse files
author
ppoffice
committed
fix(comment): disable gitment on index page
1 parent e11120f commit a3a971e

1 file changed

Lines changed: 11 additions & 11 deletions

File tree

layout/comment/gitment.ejs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22
<link rel="stylesheet" href="https://imsun.github.io/gitment/style/default.css">
33
<script src="https://imsun.github.io/gitment/dist/gitment.browser.js"></script>
44
<script>
5-
var gitment = new Gitment({
6-
owner: '<%= theme.comment.gitment.owner %>',
7-
repo: '<%= theme.comment.gitment.repo %>',
8-
oauth: {
9-
client_id: '<%= theme.comment.gitment.client_id %>',
10-
client_secret: '<%= theme.comment.gitment.client_secret %>',
11-
},
12-
})
13-
gitment.render('commentContainer')
5+
if (document.getElementById('comments')) {
6+
var gitment = new Gitment({
7+
owner: '<%= theme.comment.gitment.owner %>',
8+
repo: '<%= theme.comment.gitment.repo %>',
9+
oauth: {
10+
client_id: '<%= theme.comment.gitment.client_id %>',
11+
client_secret: '<%= theme.comment.gitment.client_secret %>',
12+
},
13+
})
14+
gitment.render('comments')
15+
}
1416
</script>
15-
<% } else { %>
16-
<div id="commentContainer"></div>
1717
<% } %>

0 commit comments

Comments
 (0)