We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b175082 commit 1aec8b7Copy full SHA for 1aec8b7
1 file changed
src/theme/DocItem/Content/index.jsx
@@ -1,12 +1,16 @@
1
import React from 'react';
2
import Content from '@theme-original/DocItem/Content';
3
-import { useLocation } from '@docusaurus/router';
+import { Redirect, useLocation } from '@docusaurus/router';
4
5
export default function DocItemContent(props) {
6
const { pathname } = useLocation();
7
const isLegacyDoc =
8
pathname.startsWith('/legacy-policies/') && pathname !== '/legacy-policies/';
9
10
+ if (pathname.length > 1 && pathname.endsWith('/')) {
11
+ return <Redirect to={pathname.slice(0, -1)}/>
12
+ }
13
+
14
return (
15
<>
16
{isLegacyDoc && (
0 commit comments