Skip to content

Commit d16c535

Browse files
authored
chore: remove broken generated .md links (#1868)
Follow-up for #1864 , should finally make the Lychee CI check fully green again. Closes #1832
1 parent 3cf2c00 commit d16c535

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

apify-docs-theme/src/theme/Layout/index.jsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,17 @@ import React from 'react';
99
export default function LayoutWrapper(props) {
1010
const { options: { subNavbar } } = usePluginData('@apify/docs-theme');
1111
const baseUrl = useBaseUrl('/');
12-
const currentPath = useLocation().pathname.replace(new RegExp(`^${baseUrl}`), '');
12+
const currentPath = useLocation().pathname.replace(new RegExp(`^${baseUrl}`), '').trim();
13+
const shouldRenderAlternateLink = currentPath && currentPath !== '404';
1314

1415
return (
1516
<>
1617
<Head>
17-
<link rel="alternate" type="text/markdown" href={`${currentPath}.md`}/>
18+
{
19+
shouldRenderAlternateLink
20+
? <link rel="alternate" type="text/markdown" href={`${currentPath}.md`}/>
21+
: null
22+
}
1823
</Head>
1924
<div
2025
style={{

0 commit comments

Comments
 (0)