网站信息卡

This commit is contained in:
2026-06-19 08:55:14 +08:00 Unverified
parent 3d5eb000f1
commit 2d4eeb362c
9 changed files with 329 additions and 5 deletions
+5 -1
View File
@@ -1,5 +1,6 @@
---
import { getCategoryHref, type BlogPost } from '@/lib/posts';
import SiteInfoCard from '@/components/SiteInfoCard.astro';
import { siteConfig } from '../../site.config.mjs';
type TocItem = {
@@ -17,9 +18,10 @@ interface Props {
post: BlogPost;
toc: TocItem[];
relatedPosts: BlogPost[];
posts: BlogPost[];
}
const { post, toc, relatedPosts } = Astro.props;
const { post, toc, relatedPosts, posts } = Astro.props;
const avatar = siteConfig.author.avatar;
const topDepth = toc.length > 0 ? Math.min(...toc.map((item) => item.depth)) : 1;
const tocSections = toc.reduce<TocSection[]>((sections, item) => {
@@ -107,5 +109,7 @@ const tocSections = toc.reduce<TocSection[]>((sections, item) => {
<p class="sidebar-empty">这个分类下暂时没有其他文章。</p>
)}
</section>
<SiteInfoCard posts={posts} />
</div>
</aside>