Given this route pages/shop/[[...slug]].js,
How to statically generate the root page (/shop in the example above?
I understand for non-optional catch-all segments
— pages/shop/[...slug].js — we can statically generate segments like so:
export function generateStaticParams() {
return [{ slug: ["a"] }, { slug: [b] }];
}
// generates
// /shop/a
// /shop/b
I’m wondering if possible to do this for the ‘root’ page when using optional catch-all segments
Thanks for the help!