Skip to content

Commit

Permalink
dogfood?
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh-Cena committed Apr 21, 2022
1 parent 76c2f2c commit 49a9fe2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/docusaurus/src/client/normalizeLocation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* LICENSE file in the root directory of this source tree.
*/

import routes from '@generated/routes';
import {matchRoutes} from 'react-router-config';
import type {Location} from 'history';

// Memoize previously normalized pathnames.
Expand All @@ -18,6 +20,11 @@ export default function normalizeLocation<T extends Location>(location: T): T {
};
}

if (matchRoutes(routes, location.pathname)) {
pathnames[location.pathname] = location.pathname;
return location;
}

const pathname =
location.pathname.trim().replace(/(?:\/index)?\.html$/, '') || '/';

Expand Down
4 changes: 4 additions & 0 deletions website/_dogfooding/_docs tests/dummy.md
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
---
slug: dummy.html
---

# Just a dummy page

0 comments on commit 49a9fe2

Please sign in to comment.