Skip to content

Commit 0eb75a3

Browse files
authored
(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.
1 parent bf8c722 commit 0eb75a3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/public/components/doc-structure.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export { content };
44
const pages = new Map(
55
content.map((item, index) => {
66
if ('heading' in item) return ['', -1];
7-
item.slug = `/docs/${item.name}`.replace(/\/index$/g, '');
7+
item.slug = `/docs/${item.name.replace(/^index$/, '')}`;
88
return [item.name, index];
99
})
1010
);

0 commit comments

Comments
 (0)