hexo-theme-butterfly/layout/includes/head/config_site.pug
Jerry 7210f5b431 breaking changes: toc 配置更改,頁面支持 toc 顯示 close #636
feat: 代碼框設置高度限制,展開後按鈕不會消失,可點擊再次摺疊 close #637
feat: 增加 no-lightbox class 偵測,可配置 fancybox 和 medium-zoom 不應用於圖片 #636
fix: 修復開啟 lazyload 時, fancybox 的縮略圖顯示 lazyload 加載圖片的 bug
2021-08-18 00:07:31 +08:00

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)}'
}