英文路径

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';
interface Props {
post: BlogPost;
@@ -15,7 +15,7 @@ const { post } = Astro.props;
{post.summary && <p>{post.summary}</p>}
</a>
<div class="meta-list">
{post.categories.map((category) => <a href={`/categories/${encodeURIComponent(category)}/`}>{category}</a>)}
{post.categories.map((category) => <a href={getCategoryHref(category)}>{category}</a>)}
{post.tags.map((tag) => <a href={`/tags/${encodeURIComponent(tag)}/`}>#{tag}</a>)}
</div>
</article>