mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-25 07:26:49 +00:00
部分配置siteConfig化
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user