--- import { type CollectionEntry, getCollection } from "astro:content"; import PageLayout from "@layouts/PageLayout.astro"; import Container from "@components/Container.astro"; import FormattedDate from "@components/FormattedDate.astro"; import BackToPrev from "@components/BackToPrev.astro"; export async function getStaticPaths() { const shots = (await getCollection("shots")).sort( (a, b) => b.data.date.valueOf() - a.data.date.valueOf(), ); return shots.map((shot) => ({ params: { slug: shot.slug, }, props: shot, })); } type Props = CollectionEntry<"shots">; const shot = Astro.props; const { Content } = await shot.render(); const dateString = shot.data.date.toString(); ---
Back to shots
{shot.data.title}