Migrate to Astro 5

This commit is contained in:
Bad Manners 2024-12-03 19:09:09 -03:00
parent 5d701069e9
commit bb1e533a00
No known key found for this signature in database
GPG key ID: 8C88292CCB075609
129 changed files with 1408 additions and 1448 deletions

View file

@ -1,29 +0,0 @@
---
import type { GetStaticPaths } from "astro";
import { type CollectionEntry, getCollection } from "astro:content";
import GameLayout from "@layouts/GameLayout.astro";
import { PUBLISH_DRAFTS } from "astro:env/server";
type Props = CollectionEntry<"games">;
type Params = {
slug: CollectionEntry<"games">["slug"];
};
export const getStaticPaths: GetStaticPaths = async () => {
const games = await getCollection("games");
return games
.filter((game) => import.meta.env.DEV || PUBLISH_DRAFTS || !game.data.isDraft)
.map((game) => ({
params: { slug: game.slug } satisfies Params,
props: game satisfies Props,
}));
};
const game = Astro.props;
const { Content } = await game.render();
---
<GameLayout {...game.data}>
<Content />
</GameLayout>