feat: 添加 GiscusComments 组件,支持文章评论功能

This commit is contained in:
joyzhao
2026-01-09 09:07:41 +08:00
parent 4bf7dd83f9
commit 1c9f154652
2 changed files with 58 additions and 0 deletions

View File

@@ -11,6 +11,7 @@ import TableOfContents from '@/components/layout/TableOfContents.astro';
import BlogNavigation from '@/components/layout/BlogNavigation.astro';
import PostMeta from '@/components/blog/PostMeta.astro';
import Container from '../components/ui/Container';
import GiscusComments from '@/components/blog/GiscusComments';
// Use Astro's MarkdownLayoutProps for proper type safety
export type Props = MarkdownLayoutProps<FrontmatterProps>;
@@ -82,6 +83,11 @@ const finalReadingTime = readTime ? parseInt(readTime.replace(/\D/g, '')) : unde
<div class="mt-8 sm:mt-12">
<BlogNavigation />
</div>
<!-- Comments Section -->
<div class="mt-10 sm:mt-16 border-t border-border pt-10">
<GiscusComments client:only="react" lang={lang} />
</div>
<!-- Author Card moved to bottom with enhanced styling -->
<div class="mt-10 sm:mt-16 border-t border-border pt-10">