+
+ {locale.COMMON.CATEGORY}:
+
+
+
{post.category}
+
- {/* 文章作者等关联信息 */}
-
-
-
- {locale.COMMON.CATEGORY}:
-
-
-
{post.category}
-
-
- {post.type[0] !== 'Page' && (
-
- {formatDate(
- post?.date?.start_date || post.createdTime,
- BLOG.lang
+ {post.type[0] !== 'Page' && (
+
+ {formatDate(
+ post?.date?.start_date || post.createdTime,
+ BLOG.lang
+ )}
+
)}
- )}
-
- {/* 不蒜子 */}
-
-
+ >)}
-
- {/* Notion文章主体 */}
- {blockMap && (
-
- )}
-
+ {/* Notion文章主体 */}
+ {blockMap && (
+
+ )}
-
-
-
+ {/* 赞赏按钮 */}
+
+ {/* 推荐文章 */}
{/* 版权声明 */}
@@ -128,8 +124,8 @@ const ArticleDetail = ({ post, blockMap, tags, prev, next, posts, categories })
+ {/* 标签列表 */}
-
{post.tagItems && (
{locale.COMMON.TAGS}:
@@ -138,13 +134,12 @@ const ArticleDetail = ({ post, blockMap, tags, prev, next, posts, categories })
))}
)}
-
-
+ {/* 上一篇下一篇文章 */}
@@ -168,6 +163,7 @@ const ArticleDetail = ({ post, blockMap, tags, prev, next, posts, categories })
+ {/* 悬浮目录按钮 */}
{
drawerRight.current.handleSwitchVisible()
@@ -183,7 +179,6 @@ export async function getStaticPaths () {
let posts = []
if (BLOG.isProd) {
posts = await getAllPosts({ from: 'slug - paths', includePage: true })
- posts = posts.filter(post => post.status[0] === 'Published')
}
return {
paths: posts.map(row => `${BLOG.path}/article/${row.slug}`),
@@ -192,8 +187,7 @@ export async function getStaticPaths () {
}
export async function getStaticProps ({ params: { slug } }) {
- let posts = await getAllPosts({ from: 'slug-props' })
- posts = posts.filter(post => post.status[0] === 'Published')
+ let posts = await getAllPosts({ from: 'slug-props', includePage: true })
const post = posts.find(t => t.slug === slug)
if (!post) {
return {