mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2026-04-12 22:17:06 +08:00
21 lines
806 B
Plaintext
21 lines
806 B
Plaintext
- const { host, siteId, language, option } = theme.remark42
|
|
|
|
script.
|
|
let nowTheme = document.documentElement.getAttribute('data-theme') === 'dark' ? 'dark' : 'light'
|
|
var remark_config = Object.assign({
|
|
host: '!{host}',
|
|
site_id: '!{siteId}',
|
|
components: ['counter']
|
|
},!{JSON.stringify(option)})
|
|
|
|
script.
|
|
function loadRemark42(){
|
|
!function(e,r){
|
|
for(var o=r.head||r.body,n=0;n<e.length;n++){
|
|
var t=r.createElement("script"),m="noModule"in t,c=m?".mjs":".js";
|
|
m&&(t.type="module"),t.async=!0,t.defer=!0,t.src=remark_config.host+"/web/"+e[n]+c,o.appendChild(t)
|
|
}
|
|
}(remark_config.components||["embed"],document)
|
|
}
|
|
|
|
window.pjax ? loadRemark42() : window.addEventListener('load', loadRemark42) |