diff --git a/apify-docs-theme/src/theme/Layout/index.jsx b/apify-docs-theme/src/theme/Layout/index.jsx index 2ca67c8a9d..3b7dd04889 100644 --- a/apify-docs-theme/src/theme/Layout/index.jsx +++ b/apify-docs-theme/src/theme/Layout/index.jsx @@ -9,12 +9,17 @@ import React from 'react'; export default function LayoutWrapper(props) { const { options: { subNavbar } } = usePluginData('@apify/docs-theme'); const baseUrl = useBaseUrl('/'); - const currentPath = useLocation().pathname.replace(new RegExp(`^${baseUrl}`), ''); + const currentPath = useLocation().pathname.replace(new RegExp(`^${baseUrl}`), '').trim(); + const shouldRenderAlternateLink = currentPath && currentPath !== '404'; return ( <> - + { + shouldRenderAlternateLink + ? + : null + }