Linloir 9f5a885f4b
All checks were successful
Deploy Pages / Generate-Pages (push) Successful in 38s
feat: upload butterfly theme
2024-10-10 00:06:54 +08:00

28 lines
914 B
Plaintext

-
const titleVal = pageTitle.replace(/'/ig,"\\'")
let isHighlightShrink
if (theme.code_blocks.shrink == 'none') isHighlightShrink = 'undefined'
else if (typeof page.highlight_shrink == 'boolean') isHighlightShrink = page.highlight_shrink
else isHighlightShrink = theme.code_blocks.shrink
var showToc = false
if (theme.aside.enable && page.aside !== false) {
let tocEnable = false
if (is_post() && theme.toc.post) tocEnable = true
else if (is_page() && theme.toc.page) tocEnable = true
const pageToc = typeof page.toc === 'boolean' ? 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)}'
}