+
-
+ {siteConfig('SIMPLE_TOP_BAR', null, CONFIG) &&
}
- {siteConfig('SIMPLE_TOP_BAR', null, CONFIG) &&
}
+ {/* 顶部LOGO */}
+
- {/* 顶部LOGO */}
-
+ {/* 导航栏 */}
+
- {/* 导航栏 */}
-
+ {/* 主体 */}
+
+
+
+ {slotTop}
- {/* 主体 */}
-
-
-
- {slotTop}
+ {children}
+
+
+
- {children}
-
-
-
-
- {fullWidth
- ? null
- :
-
-
-
-
-
- {/* 搜索框 */}
-
-
-
-
+ )}
+
+
+
+
+
+ {/* 搜索框 */}
+
+
+
+
)
}
@@ -121,9 +149,14 @@ const LayoutIndex = props => {
*/
const LayoutPostList = props => {
return (
- <>
- {siteConfig('POST_LIST_STYLE') === 'page' ?
:
}
- >
+ <>
+
+ {siteConfig('POST_LIST_STYLE') === 'page' ? (
+
+ ) : (
+
+ )}
+ >
)
}
@@ -149,7 +182,9 @@ const LayoutSearch = props => {
}
}, [])
- const slotTop = siteConfig('ALGOLIA_APP_ID') ? null :
+ const slotTop = siteConfig('ALGOLIA_APP_ID') ? null : (
+
+ )
return
}
@@ -162,11 +197,17 @@ const LayoutSearch = props => {
const LayoutArchive = props => {
const { archivePosts } = props
return (
- <>
-
- {Object.keys(archivePosts).map(archiveTitle => )}
-
- >
+ <>
+
+ {Object.keys(archivePosts).map(archiveTitle => (
+
+ ))}
+
+ >
)
}
@@ -180,39 +221,39 @@ const LayoutSlug = props => {
const { fullWidth } = useGlobal()
return (
- <>
+ <>
+ {lock &&
}
- {lock &&
}
+
+ {/* 文章信息 */}
+
-
+ {/* 广告嵌入 */}
+ {/*
*/}
+
- {/* 文章信息 */}
-
+ {/* Notion文章主体 */}
+ {!lock &&
}
- {/* 广告嵌入 */}
- {/*
*/}
-
+ {/* 分享 */}
+
- {/* Notion文章主体 */}
- {!lock &&
}
+ {/* 广告嵌入 */}
+
- {/* 分享 */}
-
+ {post?.type === 'Post' && (
+ <>
+
+
+ >
+ )}
- {/* 广告嵌入 */}
-
-
- {post?.type === 'Post' && <>
-
-
- >}
-
- {/* 评论区 */}
-
-
-
-
- >
+ {/* 评论区 */}
+
+
+ >
)
}
@@ -221,27 +262,28 @@ const LayoutSlug = props => {
* @param {*} props
* @returns
*/
-const Layout404 = (props) => {
+const Layout404 = props => {
const { post } = props
const router = useRouter()
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 <>
- 404 Not found.
- >
+ return <>404 Not found.>
}
/**
@@ -252,24 +294,27 @@ const Layout404 = (props) => {
const LayoutCategoryIndex = props => {
const { categoryOptions } = props
return (
- <>
-
- {categoryOptions?.map(category => {
- return (
-
-
- {category.name}({category.count})
-
-
- )
- })}
-
- >
+ <>
+
+ {categoryOptions?.map(category => {
+ return (
+
+
+
+ {category.name}({category.count})
+
+
+ )
+ })}
+
+ >
)
}
@@ -278,38 +323,41 @@ const LayoutCategoryIndex = props => {
* @param {*} props
* @returns
*/
-const LayoutTagIndex = (props) => {
+const LayoutTagIndex = props => {
const { tagOptions } = props
return (
- <>
-