mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2026-04-12 22:17:06 +08:00
🐛 修復BUTTON標籤嵌套使用在其他標籤時,生成多了br標籤而導致樣式不同的bugs 🐛 修復文章front-matter的highlight_shrink和toc為空時,會出現js報錯的bugs
18 lines
617 B
Plaintext
18 lines
617 B
Plaintext
-
|
|
let isHighlightShrink
|
|
if (theme.highlight_shrink == 'none') isHighlightShrink = 'undefined'
|
|
else if (page.highlight_shrink !== null && page.toc !== undefined ) isHighlightShrink = page.highlight_shrink
|
|
else isHighlightShrink = theme.highlight_shrink
|
|
|
|
const pageToc = page.toc !== null && page.toc !== undefined ? page.toc : theme.toc.enable
|
|
const showToc = is_post() && pageToc && (toc(page.content) !== '' || page.encrypt == true )
|
|
-
|
|
|
|
script.
|
|
var GLOBAL_CONFIG_SITE = {
|
|
isPost: !{is_post()},
|
|
isHome: !{is_home()},
|
|
isHighlightShrink: !{isHighlightShrink},
|
|
isSidebar: !{showToc}
|
|
}
|