Skip to content

Commit d7e6359

Browse files
committed
feat: Add site config url
1 parent bf55579 commit d7e6359

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,20 @@ import { useLocation } from '@docusaurus/router';
33
// cannot use any of the theme aliases here as it causes a circular dependency :( ideas welcome
44
import Layout from '@docusaurus/theme-classic/lib/theme/Layout/index';
55
import useBaseUrl from '@docusaurus/useBaseUrl';
6+
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
67
import { usePluginData } from '@docusaurus/useGlobalData';
78
import React from 'react';
89

910
export default function LayoutWrapper(props) {
11+
const { siteConfig } = useDocusaurusContext();
1012
const { options: { subNavbar } } = usePluginData('@apify/docs-theme');
1113
const baseUrl = useBaseUrl('/');
1214
const currentPath = useLocation().pathname.replace(new RegExp(`^${baseUrl}`), '');
1315

1416
return (
1517
<>
1618
<Head>
17-
<link rel="alternate" type="text/markdown" href={`${baseUrl}${currentPath}.md`}/>
19+
<link rel="alternate" type="text/markdown" href={`${siteConfig.url}/${currentPath}.md`}/>
1820
</Head>
1921
<div
2022
style={{

0 commit comments

Comments
 (0)