Skip to content

Commit

Permalink
(docs) URLs with trailing slashes
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
developit committed Jun 7, 2021
1 parent bf8c722 commit 0eb75a3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/public/components/doc-structure.js
Original file line number Diff line number Diff line change
Expand Up @@ -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];
})
);
Expand Down

0 comments on commit 0eb75a3

Please sign in to comment.