This commit is contained in:
Jerry
2020-03-17 21:38:27 +08:00
Unverified
2 changed files with 28 additions and 0 deletions

View File

@@ -244,12 +244,19 @@ gitalk:
repo:
owner:
admin:
<<<<<<< HEAD
language: zh-CN # en , zh-CN , zh-TW
perPage: 10 # Pagination size, with maximum 100.
distractionFreeMode: false # Facebook-like distraction free mode.
pagerDirection: last # Comment sorting direction, available values are last and first.
createIssueManually: false # Gitalk will create a corresponding github issue for your every single page automatically
count: true # top_img顯示評論數
=======
language: # en , zh-CN , zh-TW
count: false # top_img顯示評論數
createIssueManually: false
distractionFreeMode: false
>>>>>>> c40db692bfcb921b55976b6308b7d5d84f988113
# valine comment system. https://valine.js.org
valine:

View File

@@ -1,3 +1,4 @@
<<<<<<< HEAD
#gitalk-container
script.
var gitalk = new Gitalk({
@@ -15,6 +16,26 @@ script.
updateCountCallback: commentCount
})
gitalk.render('gitalk-container')
=======
if theme.gitalk && theme.gitalk.enable
#gitalk-container
script.
var createIssueManually = #{ theme.gitalk.createIssueManually } == true ? true : false;
var distractionFreeMode = #{ theme.gitalk.distractionFreeMode } == true ? true : false;
var gitalk = new Gitalk({
clientID: '!{theme.gitalk.client_id}',
clientSecret: '!{theme.gitalk.client_secret}',
repo: '!{theme.gitalk.repo}',
owner: '!{theme.gitalk.owner}',
admin: '!{theme.gitalk.admin}',
id: md5(decodeURI(location.pathname)),
createIssueManually: createIssueManually,
distractionFreeMode: distractionFreeMode,
language: '!{theme.gitalk.language}',
updateCountCallback: commentCount
})
gitalk.render('gitalk-container')
>>>>>>> c40db692bfcb921b55976b6308b7d5d84f988113
function commentCount(n){
document.getElementsByClassName('gitalk-comment-count')[0].innerHTML= n