This commit is contained in:
Luis Alvarez
2020-10-02 12:58:00 -05:00
parent 01f5b460d1
commit b6bbcf705f
3 changed files with 7 additions and 5 deletions

View File

@@ -37,9 +37,11 @@ export async function getStaticPaths() {
const { products } = await getAllProductPaths()
return {
paths: products.map((product) => ({
params: { slug: product!.node.path },
})),
paths: products.map((product) => {
const { path } = product!.node
// Exclude the slashes: `/slug/` -> `slug`
return { params: { slug: path.substring(1, path.length - 1) } }
}),
fallback: 'unstable_blocking',
}
}