+
+
-
+ {/* 顶部导航栏 */}
+
- {/* 顶部导航栏 */}
-
-
- {/* 顶部嵌入 */}
-
{
leaveFrom="opacity-100 translate-y-0"
leaveTo="opacity-0 translate-y-16"
unmount={false}
- >
- {headerSlot}
-
+ > */}
+ {headerSlot}
+ {/* */}
-
- {/* 嵌入区域 */}
-
- {containerSlot}
-
-
-
-
- {children}
-
-
-
-
-
-
- {/* 左下角悬浮 */}
-
-
-
-
- {/* 右下角悬浮 */}
-
-
- {/* 页脚 */}
-
+
+ {/* 嵌入区域 */}
+
+ {containerSlot}
+
+
+ {/* */}
+ {children}
+ {/* */}
+
+
+
+ {/* 左下角悬浮 */}
+
+
+
+
+ {/* 右下角悬浮 */}
+
+
+ {/* 页脚 */}
+
+
)
}
@@ -118,8 +137,8 @@ const LayoutBase = props => {
* @param {*} props
* @returns
*/
-const LayoutIndex = (props) => {
- return
+const LayoutIndex = props => {
+ return
}
/**
@@ -127,11 +146,15 @@ const LayoutIndex = (props) => {
* @param {*} props
* @returns
*/
-const LayoutPostList = (props) => {
+const LayoutPostList = props => {
return (
- <>
- {siteConfig('POST_LIST_STYLE') === 'page' ?
:
}
- >
+ <>
+ {siteConfig('POST_LIST_STYLE') === 'page' ? (
+
+ ) : (
+
+ )}
+ >
)
}
@@ -158,13 +181,19 @@ const LayoutSearch = props => {
}
})
return (
- <>
- {!currentSearch
- ?
- :
- {siteConfig('POST_LIST_STYLE') === 'page' ? : }
-
}
- >
+ <>
+ {!currentSearch ? (
+
+ ) : (
+
+ {siteConfig('POST_LIST_STYLE') === 'page' ? (
+
+ ) : (
+
+ )}
+
+ )}
+ >
)
}
@@ -173,21 +202,23 @@ const LayoutSearch = props => {
* @param {*} props
* @returns
*/
-const LayoutArchive = (props) => {
+const LayoutArchive = props => {
const { archivePosts } = props
- return <>
-
-
- {Object.keys(archivePosts).map(archiveTitle => (
-
- ))}
-
-
+ return (
+ <>
+
+
+ {Object.keys(archivePosts).map(archiveTitle => (
+
+ ))}
+
+
>
+ )
}
/**
@@ -202,81 +233,84 @@ const LayoutSlug = props => {
useEffect(() => {
// 404
if (!post) {
- setTimeout(() => {
- if (isBrowser) {
- const article = document.getElementById('notion-article')
- if (!article) {
- router.push('/404').then(() => {
- console.warn('找不到页面', router.asPath)
- })
+ setTimeout(
+ () => {
+ if (isBrowser) {
+ const article = document.getElementById('notion-article')
+ if (!article) {
+ router.push('/404').then(() => {
+ console.warn('找不到页面', router.asPath)
+ })
+ }
}
- }
- }, siteConfig('POST_WAITING_TIME_FOR_404') * 1000)
+ },
+ siteConfig('POST_WAITING_TIME_FOR_404') * 1000
+ )
}
}, [post])
- return (<>
+ return (
+ <>
+
+ {/* 文章主体 */}
+
+ {lock &&
}
-
+ {!lock && (
+
+ {/* 文章信息 */}
+ {post?.type && post?.type === 'Post' && (
+ <>
+
+
+ >
+ )}
- {/* 文章主体卡片 */}
-
+
+
+ {/* Notion文章主体 */}
+
- {lock && }
+ {/* 分享 */}
+
- {!lock &&
+ {/* 版权说明 */}
+ {post?.type === 'Post' &&
}
+
- {/* 文章信息 */}
- {post?.type && post?.type === 'Post' && <>
-
-
- >}
+
-
-
-
-
- {/* Notion文章主体 */}
-
-
- {/* 分享 */}
-
-
- {/* 版权说明 */}
- {post?.type === 'Post' && }
-
-
-
-
-
- {/* 评论互动 */}
-
-
-
-
-
-
}
+ {/* 评论互动 */}
+
+
+
+
+
-
- {/* 底部文章推荐 */}
- {post?.type === 'Post' &&
}
-
- {/* 底部公告 */}
-
-
- {/* 右侧文章目录 */}
-
-
+ )}
+ {/* 底部文章推荐 */}
+ {post?.type === 'Post' &&
}
+
+ {/* 底部公告 */}
+
+
+ {/* 右侧文章目录 */}
+
+
>
)
}
@@ -291,7 +325,9 @@ const Layout404 = props => {
useEffect(() => {
// 延时3秒如果加载失败就返回首页
setTimeout(() => {
- const article = typeof document !== 'undefined' && document.getElementById('notion-article')
+ const article =
+ typeof document !== 'undefined' &&
+ document.getElementById('notion-article')
if (!article) {
router.push('/').then(() => {
// console.log('找不到页面', router.asPath)
@@ -300,18 +336,18 @@ const Layout404 = props => {
}, 3000)
})
return (
- <>
-
- >
+ <>
+
+ >
)
}
@@ -324,24 +360,27 @@ const LayoutCategoryIndex = props => {
const { categoryOptions } = props
return (
- <>
-
-
-
-
- {categoryOptions?.map(e => {
- return (
-
-
- {e.name}({e.count})
-
-
- )
- })}
-
-
-
- >
+ <>
+
+
+
+ {categoryOptions?.map(e => {
+ return (
+
+
+ {e.name}({e.count})
+
+
+ )
+ })}
+
+
+
+ >
)
}
@@ -354,39 +393,39 @@ const LayoutTagIndex = props => {
const { tagOptions } = props
const { locale } = useGlobal()
return (
- <>
-
+ <>
+
+
+
+ {locale.COMMON.TAGS}
+
-
-
-
- {locale.COMMON.TAGS}
-
-
-
+
- >
+ )
+ })}
+
+
+
+ >
)
}
export {
- CONFIG as THEME_CONFIG,
+ Layout404,
+ LayoutArchive,
LayoutBase,
+ LayoutCategoryIndex,
LayoutIndex,
LayoutPostList,
LayoutSearch,
- LayoutArchive,
LayoutSlug,
- Layout404,
- LayoutCategoryIndex,
- LayoutTagIndex
+ LayoutTagIndex,
+ CONFIG as THEME_CONFIG
}