From f1a7e7fa8f68f370ebb7e1889298c4d980b541ab Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 25 Feb 2026 10:31:11 +0000 Subject: [PATCH 1/3] Initial plan From b0c37f3d13bdd7e1f2cf9926a466d0046b5957e7 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 25 Feb 2026 10:35:48 +0000 Subject: [PATCH 2/3] fix: skip rel=alternate link for versioned docs pages Co-authored-by: barjin <61918049+barjin@users.noreply.github.com> --- apify-docs-theme/src/theme/Layout/index.jsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/apify-docs-theme/src/theme/Layout/index.jsx b/apify-docs-theme/src/theme/Layout/index.jsx index b5f4d60b4f..290ba20e26 100644 --- a/apify-docs-theme/src/theme/Layout/index.jsx +++ b/apify-docs-theme/src/theme/Layout/index.jsx @@ -1,4 +1,5 @@ import Head from '@docusaurus/Head'; +import { useAllDocsData } from '@docusaurus/plugin-content-docs/client'; import { useLocation } from '@docusaurus/router'; // cannot use any of the theme aliases here as it causes a circular dependency :( ideas welcome import Layout from '@docusaurus/theme-classic/lib/theme/Layout/index'; @@ -9,8 +10,13 @@ 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}`), '').trim(); - const shouldRenderAlternateLink = currentPath && currentPath !== '404'; + const { pathname } = useLocation(); + const currentPath = pathname.replace(new RegExp(`^${baseUrl}`), '').trim(); + const allDocsData = useAllDocsData(); + const isVersionedPage = Object.values(allDocsData).some((pluginData) => + pluginData.versions.some((version) => !version.isLast && pathname.startsWith(version.path)), + ); + const shouldRenderAlternateLink = currentPath && currentPath !== '404' && !isVersionedPage; const alternateMarkdownLink = useBaseUrl(`/${currentPath}.md`, { absolute: true }); From 2285289ae4a9b96db23a78c9dc68520e29690928 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 25 Feb 2026 10:57:13 +0000 Subject: [PATCH 3/3] fix: apply linter autofix to Layout component Co-authored-by: barjin <61918049+barjin@users.noreply.github.com> --- apify-docs-theme/src/theme/Layout/index.jsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apify-docs-theme/src/theme/Layout/index.jsx b/apify-docs-theme/src/theme/Layout/index.jsx index 290ba20e26..6d93332017 100644 --- a/apify-docs-theme/src/theme/Layout/index.jsx +++ b/apify-docs-theme/src/theme/Layout/index.jsx @@ -13,9 +13,10 @@ export default function LayoutWrapper(props) { const { pathname } = useLocation(); const currentPath = pathname.replace(new RegExp(`^${baseUrl}`), '').trim(); const allDocsData = useAllDocsData(); - const isVersionedPage = Object.values(allDocsData).some((pluginData) => - pluginData.versions.some((version) => !version.isLast && pathname.startsWith(version.path)), + const isVersionedPage = Object.values(allDocsData).some( + (pluginData) => pluginData.versions.some((version) => !version.isLast && pathname.startsWith(version.path)), ); + const shouldRenderAlternateLink = currentPath && currentPath !== '404' && !isVersionedPage; const alternateMarkdownLink = useBaseUrl(`/${currentPath}.md`, { absolute: true });