mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2026-04-17 04:40:53 +08:00
breaking changes: 移除最新評論的評論服務商選擇,默認為第一個評論服務商
feat: 增加 waline avatarCDN 配置(最新評論也會更新) feat: archives 的 標題 在 menu 配置中獲取 fix: 修復文章頁 mathjax 因字體小導致顯示重疊的 bug close #587 fix: 修復 mathjax 在列表下,導致 列表沒有樣式的 bug close #586 improvement: 減少卡頓,apple 裝置首頁背景 background-attachment 設為 scroll
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
'use strict'
|
||||
|
||||
hexo.extend.helper.register('inject_head_js', function () {
|
||||
const { darkmode, aside, change_font_size } = this.theme
|
||||
const { darkmode, aside, change_font_size, index_img, disable_top_img, pjax} = this.theme
|
||||
|
||||
const localStore = `
|
||||
win.saveToLocal = {
|
||||
@@ -141,5 +141,21 @@ hexo.extend.helper.register('inject_head_js', function () {
|
||||
`
|
||||
}
|
||||
|
||||
return `<script>(win=>{${localStore + getScript + darkmodeJs + asideStatus + changFontAside}})(window)</script>`
|
||||
let detectApple = ''
|
||||
if (!disable_top_img || index_img !== false) {
|
||||
detectApple = `
|
||||
const detectApple = () => {
|
||||
if (GLOBAL_CONFIG_SITE.isHome && /iPad|iPhone|iPod|Macintosh/.test(navigator.userAgent)){
|
||||
document.documentElement.classList.add('apple')
|
||||
}
|
||||
}
|
||||
detectApple()
|
||||
`
|
||||
|
||||
if (pjax.enable) {
|
||||
detectApple += 'document.addEventListener(\'pjax:complete\', detectApple)'
|
||||
}
|
||||
}
|
||||
|
||||
return `<script>(win=>{${localStore + getScript + darkmodeJs + asideStatus + changFontAside + detectApple}})(window)</script>`
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user