the slug
This commit is contained in:
parent
fbbc2129f7
commit
403bf1faa0
1 changed files with 5 additions and 5 deletions
|
@ -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>
|
||||||
|
|
Loading…
Add table
Reference in a new issue