Have a [slug].astro file that is currently a 404:
---
import { useSanityClient } from 'astro-sanity';
export async function getStaticPaths() {
const pages = await useSanityClient().fetch(`*[_type == "pages"]`);
return pages.map(({ slug, title }) => {
return {
params: { slug: slug.current },
props: { title },
};
});
}
const { slug } = Astro.params;
const { title } = Astro.props;
---
<div>
this is a slug page
{title}
{slug}
</div>
sanity schema is Pages, with a title and slug field.
/about returns a 404 even though pages has a slug of "about" with a title of "about".
I'm able to pull the Pages data on my home page fine using the same groq query.