diff --git a/CLAUDE.md b/CLAUDE.md index bde1712f75..20f3551412 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -74,7 +74,7 @@ versions.json # Active version list - Both checks fail the build under `DOCUSAURUS_STRICT_SEO=true`. Registered **after** all `content-docs` instances so HTML is already emitted when it runs. - `agent-hint-plugin`: puts a hidden pointer to the hosted agent skill at the top of every page's `
`. See "Hosted Agent Skill" below. -Noindex for legacy versions is set declaratively in `docusaurus.config.ts` (`versions[v].noIndex: true`); template pages are marked `unlisted: true` in frontmatter. No custom plugin writes the meta tag — the versioned-seo-plugin only verifies it landed. +Noindex for legacy versions is set declaratively in `docusaurus.config.ts` (`versions[v].noIndex: true`), and the versionless `templates` instance does the same with `versions.current.noIndex: true`. Don't mark template pages `unlisted: true`: on production builds that hides them from the templates sidebar unless they are the active page. No custom plugin writes the meta tag; the versioned-seo-plugin only verifies it landed (on legacy versions). --- diff --git a/docusaurus.config.ts b/docusaurus.config.ts index 5bb1757b62..1c25d1fa49 100644 --- a/docusaurus.config.ts +++ b/docusaurus.config.ts @@ -172,6 +172,9 @@ const config: Config = { routeBasePath: "templates", sidebarPath: require.resolve("./sidebarsTemplates.js"), showLastUpdateTime: true, + // Noindex every templates page. Not `unlisted` frontmatter: that also hides + // the page from the sidebar unless it is the active one. + versions: { current: { noIndex: true } }, }, ], [ diff --git a/src/theme/DocItem/index.tsx b/src/theme/DocItem/index.tsx index 7c90ddd4a4..f3f5c86c75 100644 --- a/src/theme/DocItem/index.tsx +++ b/src/theme/DocItem/index.tsx @@ -6,8 +6,6 @@ import DocsTopbar from "@site/src/components/DocsTopbar"; import LanguageUrlSync from "@site/src/components/LanguageUrlSync"; import { SupportedLanguagesContext } from "@site/src/components/LanguageStore"; import { CustomDocFrontMatter } from "@site/src/typescript/docMetadata"; -import { useActivePlugin } from "@docusaurus/plugin-content-docs/client"; -import Head from "@docusaurus/Head"; type Props = WrapperProps