starter主题新增lite模式,隐藏页头页脚便于嵌入

This commit is contained in:
tangly1024
2025-07-11 17:29:38 +08:00
parent 5e6fa26c90
commit b2c9ed5014
2 changed files with 42 additions and 22 deletions

View File

@@ -31,6 +31,7 @@ export function GlobalContextProvider(props) {
) // 默认语言
const [theme, setTheme] = useState(NOTION_CONFIG?.THEME || THEME) // 默认博客主题
const [THEME_CONFIG, SET_THEME_CONFIG] = useState(null) // 主题配置
const [isLiteMode,setLiteMode] = useState(false)
const defaultDarkMode = NOTION_CONFIG?.APPEARANCE || APPEARANCE
const [isDarkMode, updateDarkMode] = useState(defaultDarkMode === 'dark') // 默认深色模式
@@ -107,6 +108,9 @@ export function GlobalContextProvider(props) {
const newUrl = `${url}${url.includes('?') ? '&' : '?'}theme=${themeStr}`
router.push(newUrl)
}
if (router.query.lite && router.query.lite==='true') {
setLiteMode(true)
}
if (!onLoading) {
setOnLoading(true)
}
@@ -134,6 +138,7 @@ export function GlobalContextProvider(props) {
return (
<GlobalContext.Provider
value={{
isLiteMode,
isLoaded,
isSignedIn,
user,