提取公共Head

This commit is contained in:
tangly1024
2024-02-01 21:39:17 +08:00
parent 76f0bfb350
commit 4315c5f81c
33 changed files with 226 additions and 315 deletions

View File

@@ -13,12 +13,12 @@ const GlobalContext = createContext()
*/
export function GlobalContextProvider(props) {
const { post, children, siteInfo, categoryOptions, tagOptions, NOTION_CONFIG } = props
const router = useRouter()
const [lang, updateLang] = useState(NOTION_CONFIG?.LANG || LANG) // 默认语言
const [locale, updateLocale] = useState(generateLocaleDict(NOTION_CONFIG?.LANG || LANG)) // 默认语言
const [theme, setTheme] = useState(NOTION_CONFIG?.THEME || THEME) // 默认博客主题
const [isDarkMode, updateDarkMode] = useState(NOTION_CONFIG?.APPEARANCE || APPEARANCE === 'dark') // 默认深色模式
const [onLoading, setOnLoading] = useState(false) // 抓取文章数据
const router = useRouter()
// 是否全屏
const fullWidth = post?.fullWidth ?? false