feat(blog): add tagId and categoryId for multilingual routing support

- Add tagId and categoryId fields to blog post frontmatter and interfaces
- Update blog list, category, and tag pages to use IDs for routing
- Implement fallback to regular tags/categories when IDs are not available
- Improve tag and category links with hover effects and proper encoding
- Update post meta component to support multilingual routing
This commit is contained in:
joyzhao
2025-06-19 14:08:47 +08:00
parent 601f3f06ce
commit deb80c0df7
13 changed files with 184 additions and 62 deletions

View File

@@ -44,6 +44,9 @@ export interface BlogPost {
image: string;
slug: string;
tags: string[];
tagId?: string[];
category?: string[];
categoryId?: string[];
date: string;
readTime: string;
url?: string;
@@ -59,7 +62,9 @@ export interface FrontmatterProps {
date?: string; // Alternative field name for publish date
author?: string;
tags?: string[];
tagId?: string[]; // 标签唯一标识符,用于多语言环境下的标签路由
category?: string | string[];
categoryId?: string[] | string; // 分类唯一标识符,用于多语言环境下的分类路由
readingTime?: number;
readTime?: string; // Alternative field name for reading time
}