Skip to content

Commit

Permalink
fix: Solved the problem that gitalk invalid when enable pjax
Browse files Browse the repository at this point in the history
  • Loading branch information
liuyib committed Sep 16, 2019
1 parent 2ebb018 commit ce9ce4f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions layout/_third-party/comments/gitalk.pug
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@ script(src=gitalk_md5)&attributes(dataPjax)
script&attributes(dataPjax).
function loadGitalk () {
if (!document.getElementById('gitalk-container')) return;
if (!document.getElementById('gitalk-container')) {
return;
}

var gitalk = new Gitalk({
id: md5('!{ page.path }'),
id: md5(window.location.pathname.slice(1)),
clientID: '!{ theme.gitalk.client_id }',
clientSecret: '!{ theme.gitalk.client_secret }',
repo: '!{ theme.gitalk.repo }',
Expand Down

0 comments on commit ce9ce4f

Please sign in to comment.