Hello everyone!
1) props are empty [SOLVED]
First things first: I can't seem to be able to pass props using the values returned by getStaticPaths. When I do, the Astro.props object is always empty when I access it in my components.
/src/pages/[...slug].astro
export async function getStaticPaths() {
// This is because I can't seem to use `props`
const fakeURLs = {'fr/home': undefined, 'en/home': 'en'};
const rewrite = slug => (Object.keys(fakeURLs).includes(slug) ? fakeURLs[slug] : slug);
// const links = retrieve from Storyblok
return links
.filter(link => /*...*/)
.map(link => {
const fakeSlug = rewrite(link.slug); // e.g. "/fr/home" = "/index.html"
return {
params: {
slug: fakeSlug,
},
props: {
origSlug: link.slug,
lang: link.slug.substring(0, 2),
toto: 'tata'
},
};
})
;
}
==> How do you store data in props for each path?