refactor: optimize rss generation logic

This commit is contained in:
radishzzz 2025-03-17 14:01:51 +00:00
parent f34b0cb46b
commit 0888b59c5f
7 changed files with 128 additions and 155 deletions

View file

@ -6,7 +6,7 @@ import { getCollection } from 'astro:content'
// eslint-disable-next-line antfu/no-top-level-await
const blogEntries = await getCollection('posts')
// Convert to page data objects
// Convert blog entries into a lookup object with slug as key and title/description as value
const pages = Object.fromEntries(
blogEntries.map((post: CollectionEntry<'posts'>) => [
post.slug,