Skip to content

Commit 08f4533

Browse files
HonzaTuronbarjin
andauthored
fix: Get absoluteUrl from docusaurus context (#2031)
Closes #2030 Won't work on staging unfortunately, but managed to run with production build. See comments below. --------- Co-authored-by: Jindřich Bär <[email protected]>
1 parent 552fe44 commit 08f4533

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,20 @@ import useBaseUrl from '@docusaurus/useBaseUrl';
66
import { usePluginData } from '@docusaurus/useGlobalData';
77
import React from 'react';
88

9-
import { absoluteUrl } from '../../absoluteUrl';
10-
119
export default function LayoutWrapper(props) {
1210
const { options: { subNavbar } } = usePluginData('@apify/docs-theme');
1311
const baseUrl = useBaseUrl('/');
1412
const currentPath = useLocation().pathname.replace(new RegExp(`^${baseUrl}`), '').trim();
1513
const shouldRenderAlternateLink = currentPath && currentPath !== '404';
1614

15+
const alternateMarkdownLink = useBaseUrl(`/${currentPath}.md`, { absolute: true });
16+
1717
return (
1818
<>
1919
<Head>
2020
{
2121
shouldRenderAlternateLink
22-
? <link rel="alternate" type="text/markdown" href={`${absoluteUrl}/${currentPath}.md`}/>
22+
? <link rel="alternate" type="text/markdown" href={alternateMarkdownLink}/>
2323
: null
2424
}
2525
</Head>

0 commit comments

Comments
 (0)