整理修改

This commit is contained in:
tangly1024.com
2023-11-02 14:10:46 +08:00
parent a6cc5a11f3
commit 5ccf8823a6
34 changed files with 101 additions and 80 deletions

View File

@@ -14,7 +14,7 @@ const NoFound = props => {
props = { ...props, meta }
// 根据页面路径加载不同Layout文件
const Layout = getLayoutByTheme(useRouter())
const Layout = getLayoutByTheme({ theme: siteConfig('THEME'), router: useRouter() })
return <Layout {...props} />
}

View File

@@ -67,7 +67,7 @@ const Slug = props => {
}, [post])
const meta = {
title: post ? `${post?.title} | ${siteConfig('TITLE')}` : `${props?.siteConfig('TITLE') || BLOG.TITLE} | loading`,
title: post ? `${post?.title} | ${siteConfig('TITLE')}` : `${siteConfig('TITLE')} | loading`,
description: post?.summary,
type: post?.type,
slug: post?.slug,
@@ -77,7 +77,7 @@ const Slug = props => {
}
props = { ...props, lock, meta, setLock, validPassword }
// 根据页面路径加载不同Layout文件
const Layout = getLayoutByTheme(useRouter())
const Layout = getLayoutByTheme({ theme: siteConfig('THEME'), router: useRouter() })
return <Layout {...props} />
}

View File

@@ -13,7 +13,7 @@ const ArchiveIndex = props => {
const { locale } = useGlobal()
// 根据页面路径加载不同Layout文件
const Layout = getLayoutByTheme(useRouter())
const Layout = getLayoutByTheme({ theme: siteConfig('THEME'), router: useRouter() })
useEffect(() => {
if (isBrowser) {

View File

@@ -16,7 +16,7 @@ export default function Category(props) {
const { locale } = useGlobal()
// 根据页面路径加载不同Layout文件
const Layout = getLayoutByTheme(useRouter())
const Layout = getLayoutByTheme({ theme: siteConfig('THEME'), router: useRouter() })
const meta = {
title: `${props.category} | ${locale.COMMON.CATEGORY} | ${

View File

@@ -16,7 +16,7 @@ export default function Category(props) {
const { siteInfo } = props
const { locale } = useGlobal()
// 根据页面路径加载不同Layout文件
const Layout = getLayoutByTheme(useRouter())
const Layout = getLayoutByTheme({ theme: siteConfig('THEME'), router: useRouter() })
const meta = {
title: `${props.category} | ${locale.COMMON.CATEGORY} | ${

View File

@@ -16,7 +16,7 @@ export default function Category(props) {
const { siteInfo } = props
// 根据页面路径加载不同Layout文件
const Layout = getLayoutByTheme(useRouter())
const Layout = getLayoutByTheme({ theme: siteConfig('THEME'), router: useRouter() })
const meta = {
title: `${locale.COMMON.CATEGORY} | ${siteConfig('TITLE')}`,

View File

@@ -3,9 +3,9 @@ import { getPostBlocks } from '@/lib/notion'
import { getGlobalData } from '@/lib/notion/getNotionData'
import { generateRss } from '@/lib/rss'
import { generateRobotsTxt } from '@/lib/robots.txt'
import { useRouter } from 'next/router'
import { getLayoutByTheme } from '@/themes/theme'
import { siteConfig } from '@/lib/config'
import { useRouter } from 'next/router'
/**
* 首页布局
@@ -14,7 +14,7 @@ import { siteConfig } from '@/lib/config'
*/
const Index = props => {
// 根据页面路径加载不同Layout文件
const Layout = getLayoutByTheme(useRouter())
const Layout = getLayoutByTheme({ theme: siteConfig('THEME'), router: useRouter() })
const meta = {
title: `${siteConfig('TITLE')} | ${siteConfig('BIO')}`,

View File

@@ -14,7 +14,7 @@ const Page = props => {
const { siteInfo } = props
// 根据页面路径加载不同Layout文件
const Layout = getLayoutByTheme(useRouter())
const Layout = getLayoutByTheme({ theme: siteConfig('THEME'), router: useRouter() })
const meta = {
title: `${props?.page} | Page | ${siteConfig('TITLE')}`,

View File

@@ -11,7 +11,7 @@ const Index = props => {
const { locale } = useGlobal()
// 根据页面路径加载不同Layout文件
const Layout = getLayoutByTheme(useRouter())
const Layout = getLayoutByTheme({ theme: siteConfig('THEME'), router: useRouter() })
const meta = {
title: `${keyword || ''}${keyword ? ' | ' : ''}${locale.NAV.SEARCH} | ${siteConfig('TITLE')}`,

View File

@@ -11,7 +11,7 @@ const Index = props => {
const { locale } = useGlobal()
// 根据页面路径加载不同Layout文件
const Layout = getLayoutByTheme(useRouter())
const Layout = getLayoutByTheme({ theme: siteConfig('THEME'), router: useRouter() })
const meta = {
title: `${keyword || ''}${keyword ? ' | ' : ''}${locale.NAV.SEARCH} | ${siteConfig('TITLE')}`,

View File

@@ -15,7 +15,7 @@ const Search = props => {
const { locale } = useGlobal()
// 根据页面路径加载不同Layout文件
const Layout = getLayoutByTheme(useRouter())
const Layout = getLayoutByTheme({ theme: siteConfig('THEME'), router: useRouter() })
const router = useRouter()
const keyword = getSearchKey(router)

View File

@@ -15,7 +15,7 @@ const Tag = props => {
const { tag, siteInfo } = props
// 根据页面路径加载不同Layout文件
const Layout = getLayoutByTheme(useRouter())
const Layout = getLayoutByTheme({ theme: siteConfig('THEME'), router: useRouter() })
const meta = {
title: `${tag} | ${locale.COMMON.TAGS} | ${siteConfig('TITLE')}`,

View File

@@ -10,7 +10,7 @@ const Tag = props => {
const { tag, siteInfo } = props
// 根据页面路径加载不同Layout文件
const Layout = getLayoutByTheme(useRouter())
const Layout = getLayoutByTheme({ theme: siteConfig('THEME'), router: useRouter() })
const meta = {
title: `${tag} | ${locale.COMMON.TAGS} | ${siteConfig('TITLE')}`,

View File

@@ -15,7 +15,7 @@ const TagIndex = props => {
const { siteInfo } = props
// 根据页面路径加载不同Layout文件
const Layout = getLayoutByTheme(useRouter())
const Layout = getLayoutByTheme({ theme: siteConfig('THEME'), router: useRouter() })
const meta = {
title: `${locale.COMMON.TAGS} | ${siteConfig('TITLE')}`,