🏗️ First time sync the css & js files from hexo theme NexT
This commit is contained in:
24
assets/js/third-party/comments/gitalk.js
vendored
Normal file
24
assets/js/third-party/comments/gitalk.js
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
/* global NexT, CONFIG, Gitalk */
|
||||
|
||||
document.addEventListener('page:loaded', () => {
|
||||
if (!CONFIG.page.comments) return;
|
||||
|
||||
NexT.utils.loadComments('.gitalk-container')
|
||||
.then(() => NexT.utils.getScript(CONFIG.gitalk.js, {
|
||||
condition: window.Gitalk
|
||||
}))
|
||||
.then(() => {
|
||||
const gitalk = new Gitalk({
|
||||
clientID : CONFIG.gitalk.client_id,
|
||||
clientSecret : CONFIG.gitalk.client_secret,
|
||||
repo : CONFIG.gitalk.repo,
|
||||
owner : CONFIG.gitalk.github_id,
|
||||
admin : [CONFIG.gitalk.admin_user],
|
||||
id : CONFIG.gitalk.path_md5,
|
||||
proxy : CONFIG.gitalk.proxy,
|
||||
language : CONFIG.gitalk.language || window.navigator.language,
|
||||
distractionFreeMode: CONFIG.gitalk.distraction_free_mode
|
||||
});
|
||||
gitalk.render(document.querySelector('.gitalk-container'));
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user