This commit is contained in:
Lio 2024-07-20 10:25:53 +02:00
parent fbbc2129f7
commit 403bf1faa0

View file

@ -1,9 +1,9 @@
--- ---
import type { GetStaticPaths } from "astro"; // import type { GetStaticPaths } from "astro";
import Gallery from "../../layouts/Gallery.astro"; import Gallery from "../../layouts/Gallery.astro";
import Image from "../../components/Image.astro"; import Image from "../../components/Image.astro";
import pb from "../../lib/pb"; import pb from "../../lib/pb";
export const getStaticPaths = (async () => { export async function getStaticPaths() {
const paths = await pb const paths = await pb
.collection("characters") .collection("characters")
.getFullList({ .getFullList({
@ -13,12 +13,12 @@ export const getStaticPaths = (async () => {
// console.log(paths); // console.log(paths);
return paths.map(({ slug, name }) => { return paths.map(({ slug }) => {
return { return {
params: { slug }, params: { slug },
}; };
}); });
}) satisfies GetStaticPaths; }
const { slug } = Astro.params; const { slug } = Astro.params;
@ -39,7 +39,7 @@ const images = imageCollection.map((record) => {
}; };
}); });
export const prerender = true export const prerender = true;
--- ---
<Gallery> <Gallery>