refactor: optimize multilingual article routing logic, modify slug to abbrlink

This commit is contained in:
radishzzz 2025-03-11 00:34:30 +00:00
parent 16491dae50
commit e5165dd740
16 changed files with 673 additions and 133 deletions

View file

@ -46,7 +46,7 @@ export async function generateRSS({ lang }: GenerateRSSOptions = {}) {
description: post.data.description || getExcerpt(post.body),
// Generate absolute URL with optional language prefix
link: new URL(
`${lang ? `${lang}/` : ''}posts/${post.data.slug || post.slug}/`,
`${lang ? `${lang}/` : ''}posts/${post.data.abbrlink || post.slug}/`,
url,
).toString(),
// Convert markdown content to HTML, allowing img tags