--- import Layout from "../../../layouts/Layout.astro" import BlogPost from "../../../components/BlogPost.astro" import styles from "../../../styles/Blog.module.css" import { CollectionEntry, getCollection } from "astro:content" import { micromark } from "micromark" import categories from "../../../categories" import Divider from "../../../components/Divider.astro" type Post = CollectionEntry<"blog"> export const getStaticPaths = async () => { const posts = await getCollection("blog") return categories.map(([category, properties]) => ({ params: { category: properties.default ? undefined : category }, props: { filteredPosts: properties.default ? posts : posts.filter((post) => post.data.category == category), categoryProperties: properties } })) } const { category } = Astro.params const { filteredPosts, categoryProperties } = Astro.props --- { categoryProperties.descriptionTitle || categoryProperties.title } { filteredPosts.map((post: Post) => ( )) }