From 092919a5494babac00817990fc3e8110557ccc6c Mon Sep 17 00:00:00 2001 From: wj-Mcat <1435130236@qq.com> Date: Sun, 18 Aug 2024 20:02:24 +0800 Subject: [PATCH] update blog comment --- docs/00-agent-intro/00-what-is-agent.md | 2 +- src/components/GiscusComponent.tsx | 8 ++++---- src/theme/BlogPostItem/index.tsx | 24 +++++++++++------------- 3 files changed, 16 insertions(+), 18 deletions(-) diff --git a/docs/00-agent-intro/00-what-is-agent.md b/docs/00-agent-intro/00-what-is-agent.md index ca63241..ac858df 100644 --- a/docs/00-agent-intro/00-what-is-agent.md +++ b/docs/00-agent-intro/00-what-is-agent.md @@ -1,7 +1,7 @@ --- +comments: true sidebar_position: 1 slug: what-is-agent -enableComments: true --- # 什么是Agent diff --git a/src/components/GiscusComponent.tsx b/src/components/GiscusComponent.tsx index 0306f6b..dbd30ba 100644 --- a/src/components/GiscusComponent.tsx +++ b/src/components/GiscusComponent.tsx @@ -9,16 +9,16 @@ export default function GiscusComponent() { ; - const { frontMatter, slug, title } = metadata - const { enableComments } = frontMatter +export default function BlogPostItemWrapper(props: Props): JSX.Element { + const { metadata, isBlogPostPage } = useBlogPost(); + const { comments = true } = metadata.frontMatter; return ( <> - {(enableComments && isBlogPostPage) && ( - - )} + {comments && isBlogPostPage && } ); } \ No newline at end of file