Migrate to Astro 5
This commit is contained in:
parent
5d701069e9
commit
bb1e533a00
129 changed files with 1408 additions and 1448 deletions
|
|
@ -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>
|
||||
Loading…
Add table
Add a link
Reference in a new issue