refactor: separate rss and atom generation, optimize back button logic (#22)

* refactor: separate rss and atom generation, optimize back button logic, remove redundant whitespace in component styles

* fix:  add missing <published> tag in atom feed
This commit is contained in:
radishzz 2025-05-10 04:37:20 +01:00 committed by GitHub
parent 4b05ba9caf
commit fc1cc050bc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 576 additions and 418 deletions

View file

@ -1,6 +1,6 @@
import type { APIContext } from 'astro'
import { moreLocales } from '@/config'
import { generateRSS } from '@/utils/rss'
import { generateAtom } from '@/utils/feed'
export function getStaticPaths() {
return moreLocales.map(lang => ({
@ -8,7 +8,6 @@ export function getStaticPaths() {
}))
}
export async function GET({ params }: APIContext) {
const lang = params.lang as typeof moreLocales[number]
return generateRSS({ lang })
export async function GET(context: APIContext) {
return generateAtom(context)
}