Skip to content

Commit ae6292c

Browse files
committed
feat: markdown alternate
1 parent 357eb56 commit ae6292c

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed
Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import Head from '@docusaurus/Head';
12
import { useLocation } from '@docusaurus/router';
23
// cannot use any of the theme aliases here as it causes a circular dependency :( ideas welcome
34
import Layout from '@docusaurus/theme-classic/lib/theme/Layout/index';
@@ -11,13 +12,19 @@ export default function LayoutWrapper(props) {
1112
const currentPath = useLocation().pathname.replace(new RegExp(`^${baseUrl}`), '');
1213

1314
return (
14-
<div style={{
15-
'--ifm-navbar-height': subNavbar && !currentPath.startsWith('api/v2') ? '126px' : '68px',
16-
margin: 0,
17-
padding: 0,
18-
boxSizing: 'border-box',
19-
}}>
20-
<Layout {...props} />
21-
</div>
15+
<>
16+
<Head>
17+
<link rel="alternate" type="text/markdown" href={`${currentPath}.md`}/>
18+
</Head>
19+
<div
20+
style={{
21+
'--ifm-navbar-height': subNavbar && !currentPath.startsWith('api/v2') ? '126px' : '68px',
22+
margin: 0,
23+
padding: 0,
24+
boxSizing: 'border-box',
25+
}}>
26+
<Layout {...props} />
27+
</div>
28+
</>
2229
);
2330
}

0 commit comments

Comments
 (0)