部分配置siteConfig化

This commit is contained in:
tangly1024.com
2023-11-01 18:40:00 +08:00
parent 70f6413fb2
commit 52495e0200
80 changed files with 293 additions and 200 deletions

View File

@@ -1,10 +1,10 @@
import { generateLocaleDict, initLocale } from './lang'
import { createContext, useContext, useEffect, useState } from 'react'
import { useRouter } from 'next/router'
import BLOG from '@/blog.config'
import { THEMES, initDarkMode } from '@/themes/theme'
import NProgress from 'nprogress'
import { getQueryVariable, isBrowser } from './utils'
import BLOG from '@/blog.config'
const GlobalContext = createContext()
@@ -15,7 +15,7 @@ const GlobalContext = createContext()
* @constructor
*/
export function GlobalContextProvider(props) {
const { children, siteInfo, categoryOptions, tagOptions } = props
const { children, siteInfo, categoryOptions, tagOptions, NOTION_CONFIG } = props
const router = useRouter()
const [lang, updateLang] = useState(BLOG.LANG) // 默认语言
const [locale, updateLocale] = useState(generateLocaleDict(BLOG.LANG)) // 默认语言
@@ -68,6 +68,7 @@ export function GlobalContextProvider(props) {
return (
<GlobalContext.Provider value={{
NOTION_CONFIG,
onLoading,
setOnLoading,
locale,