theme 加载优化

This commit is contained in:
tangly1024.com
2024-01-30 12:50:13 +08:00
parent 7b56f15d4d
commit b415446aa6
12 changed files with 185 additions and 241 deletions

View File

@@ -193,7 +193,7 @@ const LayoutIndex = (props) => {
})
}, [])
return <LayoutBase {...props} />
return <div {...props} />
}
/**
@@ -203,9 +203,9 @@ const LayoutIndex = (props) => {
* @returns
*/
const LayoutPostList = (props) => {
return <LayoutBase {...props} >
return <div {...props} >
<div className='mt-10'><BlogPostListPage {...props} /></div>
</LayoutBase>
</div>
}
/**
@@ -217,7 +217,7 @@ const LayoutSlug = (props) => {
const { post, prev, next, lock, validPassword } = props
return (
<LayoutBase {...props} >
<div {...props} >
{/* 文章锁 */}
{lock && <ArticleLock validPassword={validPassword} />}
@@ -250,7 +250,7 @@ const LayoutSlug = (props) => {
<TocDrawer {...props} />
</div>}
</LayoutBase>
</div>
)
}
@@ -261,7 +261,7 @@ const LayoutSlug = (props) => {
* @returns
*/
const LayoutSearch = (props) => {
return <LayoutBase {...props}></LayoutBase>
return <div {...props}></div>
}
/**
@@ -273,20 +273,20 @@ const LayoutSearch = (props) => {
const LayoutArchive = (props) => {
const { archivePosts } = props
return <LayoutBase {...props}>
return <div {...props}>
<div className="mb-10 pb-20 md:py-12 py-3 min-h-full">
{Object.keys(archivePosts)?.map(archiveTitle => <BlogArchiveItem key={archiveTitle} archiveTitle={archiveTitle} archivePosts={archivePosts} />)}
</div>
</LayoutBase>
</div>
}
/**
* 404
*/
const Layout404 = props => {
return <LayoutBase {...props}>
return <div {...props}>
<div className='w-full h-96 py-80 flex justify-center items-center'>404 Not found.</div>
</LayoutBase>
</div>
}
/**
@@ -295,7 +295,7 @@ const Layout404 = props => {
const LayoutCategoryIndex = (props) => {
const { categoryOptions } = props
const { locale } = useGlobal()
return <LayoutBase {...props}>
return <div {...props}>
<div className='bg-white dark:bg-gray-700 py-10'>
<div className='dark:text-gray-200 mb-5'>
<i className='mr-4 fas fa-th' />{locale.COMMON.CATEGORY}:
@@ -317,7 +317,7 @@ const LayoutCategoryIndex = (props) => {
})}
</div>
</div>
</LayoutBase>
</div>
}
/**
@@ -327,7 +327,7 @@ const LayoutTagIndex = (props) => {
const { tagOptions } = props
const { locale } = useGlobal()
return <LayoutBase {...props}>
return <div {...props}>
<div className="bg-white dark:bg-gray-700 py-10">
<div className="dark:text-gray-200 mb-5">
<i className="mr-4 fas fa-tag" />
@@ -343,11 +343,12 @@ const LayoutTagIndex = (props) => {
})}
</div>
</div>
</LayoutBase>
</div>
}
export {
CONFIG as THEME_CONFIG,
LayoutBase,
LayoutIndex,
LayoutSearch,
LayoutArchive,