feat: complete language switching functionality and centralized page routing

This commit is contained in:
radishzzz 2025-03-14 03:30:56 +00:00
parent 4651828dd1
commit 05d3a8034b
26 changed files with 253 additions and 146 deletions

View file

@ -1,5 +1,6 @@
import type { APIContext } from 'astro'
import themeConfig from '@/config'
import { generateMultiLangPaths } from '@/i18n/route'
import { generateRSS } from '@/utils/rss'
const { moreLocale } = themeConfig.global
@ -9,7 +10,7 @@ type SupportedLanguage = typeof moreLocale[number]
// Generate static paths for all supported languages
export function getStaticPaths() {
return moreLocale.map((lang: SupportedLanguage) => ({ params: { lang } }))
return generateMultiLangPaths()
}
export async function GET({ params }: APIContext) {