--- import BaseHead from "../../components/BaseHead.astro"; import Header from "../../components/Header.astro"; import Footer from "../../components/Footer.astro"; import { SITE_TITLE, SITE_DESCRIPTION } from "../../consts"; import { getCollection } from "astro:content"; import FormattedDate from "../../components/FormattedDate.astro"; const blogs = await getCollection("blog"); const posts = blogs.sort( (a, b) => b.data.pubDate.valueOf() - a.data.pubDate.valueOf() ); const events = Object.keys( Object.groupBy( blogs.map((b) => ({ id: b.id, event: b.id.split("/").at(-2) || "", })), (b) => b.event ) ).toSorted((a, b) => +a.split("-").at(-1)!! - +b.split("-").at(-1)!!); console.log(events); ---