mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2025-09-15 12:58:48 +08:00
feat: 代碼框設置高度限制,展開後按鈕不會消失,可點擊再次摺疊 close #637 feat: 增加 no-lightbox class 偵測,可配置 fancybox 和 medium-zoom 不應用於圖片 #636 fix: 修復開啟 lazyload 時, fancybox 的縮略圖顯示 lazyload 加載圖片的 bug
31 lines
948 B
Plaintext
31 lines
948 B
Plaintext
-
|
|
const titleVal = pageTitle.replace(/'/ig,"\\'")
|
|
|
|
let isHighlightShrink
|
|
if (theme.highlight_shrink == 'none') isHighlightShrink = 'undefined'
|
|
else if (page.highlight_shrink === true || page.highlight_shrink === false) isHighlightShrink = page.highlight_shrink
|
|
else isHighlightShrink = theme.highlight_shrink
|
|
|
|
var showToc = false
|
|
if (theme.aside.enable) {
|
|
let tocEnable = false
|
|
if (is_post()) {
|
|
if (theme.toc.post) tocEnable = true
|
|
} else if (is_page()) {
|
|
if (theme.toc.page) tocEnable = true
|
|
}
|
|
const pageToc = page.toc === true || page.toc === false ? page.toc : tocEnable
|
|
showToc = pageToc && (toc(page.content) !== '' || page.encrypt == true )
|
|
}
|
|
-
|
|
|
|
script#config-diff.
|
|
var GLOBAL_CONFIG_SITE = {
|
|
title: '!{titleVal}',
|
|
isPost: !{is_post()},
|
|
isHome: !{is_home()},
|
|
isHighlightShrink: !{isHighlightShrink},
|
|
isToc: !{showToc},
|
|
postUpdate: '!{full_date(page.updated)}'
|
|
}
|