From 0eb75a39398ffae356fedd641f3360c24c6f66b0 Mon Sep 17 00:00:00 2001 From: Jason Miller Date: Sun, 6 Jun 2021 21:28:05 -0400 Subject: [PATCH] (docs) URLs with trailing slashes It looks like Netlify automatically redirects to URLs with trailing slashes (go to `wmr.dev/docs`, then reload). I'm not sure if there's a way to turn that off on the Netlify side? If not, we can just generate them with trailing slashes to match. --- docs/public/components/doc-structure.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/public/components/doc-structure.js b/docs/public/components/doc-structure.js index 1acdc36d7..e44c8b5ff 100644 --- a/docs/public/components/doc-structure.js +++ b/docs/public/components/doc-structure.js @@ -4,7 +4,7 @@ export { content }; const pages = new Map( content.map((item, index) => { if ('heading' in item) return ['', -1]; - item.slug = `/docs/${item.name}`.replace(/\/index$/g, ''); + item.slug = `/docs/${item.name.replace(/^index$/, '')}`; return [item.name, index]; }) );