mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2026-04-10 21:17:07 +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:
@@ -70,3 +70,22 @@ hexo.extend.helper.register('injectHtml', function (data) {
|
||||
}
|
||||
return result
|
||||
})
|
||||
|
||||
hexo.extend.helper.register('findArchivesTitle', function (menu) {
|
||||
const defaultTitle = this._p('page.archives')
|
||||
if (!menu) return defaultTitle
|
||||
|
||||
const loop = (m) => {
|
||||
for (const key in m) {
|
||||
if (typeof m[key] === 'object') {
|
||||
loop(m[key])
|
||||
}
|
||||
|
||||
if (/\/archives\//.test(m[key])) {
|
||||
return key
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return loop(menu) || defaultTitle
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user