英文路径

This commit is contained in:
2026-06-18 21:50:53 +08:00 Unverified
parent cb244eb983
commit fc76f9949f
6 changed files with 38 additions and 11 deletions
+2 -2
View File
@@ -1,5 +1,5 @@
---
import type { BlogPost } from '@/lib/posts';
import { getCategoryHref, type BlogPost } from '@/lib/posts';
type TocItem = {
depth: number;
@@ -38,7 +38,7 @@ const tocSections = toc.reduce<TocSection[]>((sections, item) => {
<div class="profile-name">biss</div>
<div class="article-author-meta">
<span>{post.dateText}</span>
{post.categories[0] && <a href={`/categories/${encodeURIComponent(post.categories[0])}/`}>{post.categories[0]}</a>}
{post.categories[0] && <a href={getCategoryHref(post.categories[0])}>{post.categories[0]}</a>}
</div>
</section>