File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
apify-docs-theme/src/theme/Layout Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -9,12 +9,17 @@ import React from 'react';
99export 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 = { {
You can’t perform that action at this time.
0 commit comments