mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-14 07:26:52 +00:00
Common
This commit is contained in:
@@ -17,8 +17,6 @@ import dynamic from 'next/dynamic'
|
||||
|
||||
// 自定义样式css和js引入
|
||||
import ExternalScript from '@/components/ExternalScript'
|
||||
import CommonHead from '@/components/CommonHead'
|
||||
|
||||
// 各种扩展插件 动画等
|
||||
const ExternalPlugins = dynamic(() => import('@/components/ExternalPlugins'))
|
||||
|
||||
@@ -26,11 +24,9 @@ const MyApp = ({ Component, pageProps }) => {
|
||||
useEffect(() => {
|
||||
AOS.init()
|
||||
}, [])
|
||||
const { meta } = pageProps
|
||||
|
||||
return (
|
||||
<GlobalContextProvider {...pageProps}>
|
||||
<CommonHead meta={meta}/>
|
||||
<ExternalScript />
|
||||
<Component {...pageProps} />
|
||||
<ExternalPlugins {...pageProps} />
|
||||
|
||||
@@ -26,6 +26,7 @@ import TagItem from './components/TagItem'
|
||||
import { useRouter } from 'next/router'
|
||||
import { Transition } from '@headlessui/react'
|
||||
import { Style } from './style'
|
||||
import CommonHead from '@/components/CommonHead'
|
||||
|
||||
/**
|
||||
* 基础布局框架
|
||||
@@ -35,7 +36,7 @@ import { Style } from './style'
|
||||
* @constructor
|
||||
*/
|
||||
const LayoutBase = props => {
|
||||
const { children, slotTop } = props
|
||||
const { children, slotTop, meta } = props
|
||||
const { onLoading } = useGlobal()
|
||||
|
||||
// 增加一个状态以触发 Transition 组件的动画
|
||||
@@ -48,6 +49,10 @@ const LayoutBase = props => {
|
||||
|
||||
return (
|
||||
<div id='theme-example' className='dark:text-gray-300 bg-white dark:bg-black'>
|
||||
|
||||
{/* SEO信息 */}
|
||||
<CommonHead meta={meta}/>
|
||||
|
||||
<Style/>
|
||||
|
||||
{/* 页头 */}
|
||||
|
||||
@@ -20,6 +20,7 @@ import dynamic from 'next/dynamic'
|
||||
import { AdSlot } from '@/components/GoogleAdsense'
|
||||
import { Style } from './style'
|
||||
import replaceSearchResult from '@/components/Mark'
|
||||
import CommonHead from '@/components/CommonHead'
|
||||
|
||||
const Live2D = dynamic(() => import('@/components/Live2D'))
|
||||
|
||||
@@ -42,7 +43,7 @@ export const useFukasawaGlobal = () => useContext(ThemeGlobalFukasawa)
|
||||
* @constructor
|
||||
*/
|
||||
const LayoutBase = (props) => {
|
||||
const { children, headerSlot } = props
|
||||
const { children, headerSlot, meta } = props
|
||||
const leftAreaSlot = <Live2D />
|
||||
const { onLoading } = useGlobal()
|
||||
|
||||
@@ -65,6 +66,8 @@ const LayoutBase = (props) => {
|
||||
<ThemeGlobalFukasawa.Provider value={{ isCollapsed, setIsCollapse }}>
|
||||
|
||||
<div id='theme-fukasawa'>
|
||||
{/* SEO信息 */}
|
||||
<CommonHead meta={meta}/>
|
||||
<Style/>
|
||||
|
||||
<TopNav {...props} />
|
||||
|
||||
@@ -30,6 +30,7 @@ import NotionPage from '@/components/NotionPage'
|
||||
import { ArticleLock } from './components/ArticleLock'
|
||||
import { Transition } from '@headlessui/react'
|
||||
import { Style } from './style'
|
||||
import CommonHead from '@/components/CommonHead'
|
||||
|
||||
// 主题全局变量
|
||||
const ThemeGlobalGitbook = createContext()
|
||||
@@ -42,7 +43,7 @@ export const useGitBookGlobal = () => useContext(ThemeGlobalGitbook)
|
||||
* @constructor
|
||||
*/
|
||||
const LayoutBase = (props) => {
|
||||
const { children, post, allNavPages, slotLeft, slotRight, slotTop } = props
|
||||
const { children, post, allNavPages, slotLeft, slotRight, slotTop, meta } = props
|
||||
const { onLoading } = useGlobal()
|
||||
const router = useRouter()
|
||||
const [tocVisible, changeTocVisible] = useState(false)
|
||||
@@ -58,6 +59,7 @@ const LayoutBase = (props) => {
|
||||
|
||||
return (
|
||||
<ThemeGlobalGitbook.Provider value={{ tocVisible, changeTocVisible, filteredNavPages, setFilteredNavPages, allNavPages, pageNavVisible, changePageNavVisible }}>
|
||||
<CommonHead meta={meta}/>
|
||||
<Style/>
|
||||
|
||||
<div id='theme-gitbook' className='bg-white dark:bg-hexo-black-gray w-full h-full min-h-screen justify-center dark:text-gray-300'>
|
||||
|
||||
@@ -39,10 +39,12 @@ import LazyImage from '@/components/LazyImage'
|
||||
* @constructor
|
||||
*/
|
||||
const LayoutBase = props => {
|
||||
const { children, headerSlot, slotTop, slotRight, siteInfo, className } = props
|
||||
const { children, headerSlot, slotTop, slotRight, siteInfo, className, meta } = props
|
||||
|
||||
return (
|
||||
<div id='theme-heo' className='bg-[#f7f9fe] dark:bg-[#18171d] h-full min-h-screen flex flex-col'>
|
||||
{/* SEO信息 */}
|
||||
<CommonHead meta={meta}/>
|
||||
<Style />
|
||||
|
||||
{/* 顶部嵌入 导航栏,首页放hero,文章页放文章详情 */}
|
||||
|
||||
@@ -47,7 +47,7 @@ const LayoutBase = props => {
|
||||
return (
|
||||
<div id='theme-hexo'>
|
||||
{/* 网页SEO */}
|
||||
<CommonHead meta={meta} siteInfo={siteInfo} />
|
||||
<CommonHead meta={meta}/>
|
||||
<Style/>
|
||||
|
||||
{/* 顶部导航 */}
|
||||
|
||||
@@ -35,6 +35,7 @@ import { Transition } from '@headlessui/react'
|
||||
import { Style } from './style'
|
||||
import replaceSearchResult from '@/components/Mark'
|
||||
import ArticleInfo from './components/ArticleInfo'
|
||||
import CommonHead from '@/components/CommonHead'
|
||||
|
||||
// 主题全局状态
|
||||
const ThemeGlobalMedium = createContext()
|
||||
@@ -47,7 +48,7 @@ export const useMediumGlobal = () => useContext(ThemeGlobalMedium)
|
||||
* @constructor
|
||||
*/
|
||||
const LayoutBase = props => {
|
||||
const { children, showInfoCard = true, slotRight, slotTop, siteInfo, notice } = props
|
||||
const { children, showInfoCard = true, slotRight, slotTop, siteInfo, notice, meta } = props
|
||||
const { locale } = useGlobal()
|
||||
const router = useRouter()
|
||||
const [tocVisible, changeTocVisible] = useState(false)
|
||||
@@ -55,6 +56,8 @@ const LayoutBase = props => {
|
||||
|
||||
return (
|
||||
<ThemeGlobalMedium.Provider value={{ tocVisible, changeTocVisible }}>
|
||||
{/* SEO相关 */}
|
||||
<CommonHead meta={meta}/>
|
||||
{/* CSS样式 */}
|
||||
<Style/>
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@ import BlogListBar from './components/BlogListBar'
|
||||
import { Transition } from '@headlessui/react'
|
||||
import { Style } from './style'
|
||||
import replaceSearchResult from '@/components/Mark'
|
||||
import CommonHead from '@/components/CommonHead'
|
||||
|
||||
/**
|
||||
* 基础布局 采用左中右三栏布局,移动端使用顶部导航栏
|
||||
@@ -32,7 +33,7 @@ import replaceSearchResult from '@/components/Mark'
|
||||
* @constructor
|
||||
*/
|
||||
const LayoutBase = (props) => {
|
||||
const { children, headerSlot, floatSlot, rightAreaSlot, siteInfo } = props
|
||||
const { children, headerSlot, floatSlot, rightAreaSlot, siteInfo, meta } = props
|
||||
const { onLoading } = useGlobal()
|
||||
const targetRef = useRef(null)
|
||||
const floatButtonGroup = useRef(null)
|
||||
@@ -69,6 +70,8 @@ const LayoutBase = (props) => {
|
||||
|
||||
return (
|
||||
<div id='theme-next'>
|
||||
{/* SEO相关 */}
|
||||
<CommonHead meta={meta}/>
|
||||
<Style/>
|
||||
|
||||
{/* 移动端顶部导航栏 */}
|
||||
|
||||
@@ -23,6 +23,7 @@ import BlogListBar from './components/BlogListBar'
|
||||
import { Transition } from '@headlessui/react'
|
||||
import { Style } from './style'
|
||||
import replaceSearchResult from '@/components/Mark'
|
||||
import CommonHead from '@/components/CommonHead'
|
||||
|
||||
/**
|
||||
* 基础布局 采用左右两侧布局,移动端使用顶部导航栏
|
||||
@@ -31,13 +32,15 @@ import replaceSearchResult from '@/components/Mark'
|
||||
* @constructor
|
||||
*/
|
||||
const LayoutBase = props => {
|
||||
const { children, post, topSlot } = props
|
||||
const { children, post, topSlot, meta } = props
|
||||
|
||||
const fullWidth = post?.fullWidth ?? false
|
||||
const { onLoading } = useGlobal()
|
||||
|
||||
return (
|
||||
<div id='theme-nobelium' className='nobelium relative dark:text-gray-300 w-full bg-white dark:bg-black min-h-screen'>
|
||||
{/* SEO相关 */}
|
||||
<CommonHead meta={meta}/>
|
||||
{/* SEO相关 */}
|
||||
<Style/>
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@ import { saveDarkModeToCookies } from '@/themes/theme'
|
||||
import Modal from './components/Modal'
|
||||
import { Style } from './style'
|
||||
import replaceSearchResult from '@/components/Mark'
|
||||
import CommonHead from '@/components/CommonHead'
|
||||
|
||||
// 主题全局状态
|
||||
const ThemeGlobalPlog = createContext()
|
||||
@@ -34,7 +35,7 @@ export const usePlogGlobal = () => useContext(ThemeGlobalPlog)
|
||||
* @constructor
|
||||
*/
|
||||
const LayoutBase = props => {
|
||||
const { children, topSlot } = props
|
||||
const { children, topSlot, meta } = props
|
||||
const { onLoading, updateDarkMode } = useGlobal()
|
||||
const [showModal, setShowModal] = useState(false)
|
||||
const [modalContent, setModalContent] = useState(null)
|
||||
@@ -58,6 +59,8 @@ const LayoutBase = props => {
|
||||
return (
|
||||
<ThemeGlobalPlog.Provider value={{ showModal, setShowModal, modalContent, setModalContent }}>
|
||||
<div id='theme-plog' className='plog relative dark:text-gray-300 w-full bg-black min-h-screen'>
|
||||
{/* SEO相关 */}
|
||||
<CommonHead meta={meta}/>
|
||||
<Style/>
|
||||
|
||||
{/* 移动端顶部导航栏 */}
|
||||
|
||||
@@ -24,6 +24,7 @@ import SearchInput from './components/SearchInput'
|
||||
import { Transition } from '@headlessui/react'
|
||||
import { Style } from './style'
|
||||
import replaceSearchResult from '@/components/Mark'
|
||||
import CommonHead from '@/components/CommonHead'
|
||||
|
||||
/**
|
||||
* 基础布局
|
||||
@@ -32,7 +33,7 @@ import replaceSearchResult from '@/components/Mark'
|
||||
* @returns
|
||||
*/
|
||||
const LayoutBase = props => {
|
||||
const { children, slotTop } = props
|
||||
const { children, slotTop, meta } = props
|
||||
const { onLoading } = useGlobal()
|
||||
|
||||
if (isBrowser()) {
|
||||
@@ -40,6 +41,8 @@ const LayoutBase = props => {
|
||||
}
|
||||
return (
|
||||
<div id='theme-simple' className='min-h-screen flex flex-col dark:text-gray-300 bg-white dark:bg-black'>
|
||||
{/* SEO相关 */}
|
||||
<CommonHead meta={meta}/>
|
||||
<Style/>
|
||||
|
||||
{CONFIG.TOP_BAR && <TopBar {...props} />}
|
||||
|
||||
Reference in New Issue
Block a user