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; @@ -15,8 +13,6 @@ export default function DocItemWrapper(props: Props): ReactNode { const title = props.content.metadata?.title; const source = props.content.metadata?.source as string | undefined; const frontMatter = props.content.frontMatter as CustomDocFrontMatter; - const activePlugin = useActivePlugin(); - const pluginId = activePlugin?.pluginId; const isDocsOrVersioned = source?.startsWith("@site/docs/") || @@ -31,15 +27,8 @@ export default function DocItemWrapper(props: Props): ReactNode { const showTopbar = Boolean(isDocsOrVersioned && !isExcluded); - const isTemplatesPlugin = pluginId === "templates"; - return ( - {isTemplatesPlugin && ( - - - - )} {supportedLanguages?.length ? : null} {showTopbar && }
diff --git a/templates/authors.mdx b/templates/authors.mdx index a40bd1ebbc..e7a327267d 100644 --- a/templates/authors.mdx +++ b/templates/authors.mdx @@ -1,6 +1,5 @@ --- title: "Authors" -unlisted: true hide_table_of_contents: false sidebar_label: Authors see_also: diff --git a/templates/featured-guides.mdx b/templates/featured-guides.mdx index 4ef04c3e28..59d715022a 100644 --- a/templates/featured-guides.mdx +++ b/templates/featured-guides.mdx @@ -1,6 +1,5 @@ --- title: "Featured guides" -unlisted: true hide_table_of_contents: false sidebar_label: Featured guides see_also: diff --git a/templates/frames.mdx b/templates/frames.mdx index eee7bc720c..adb3492e96 100644 --- a/templates/frames.mdx +++ b/templates/frames.mdx @@ -1,6 +1,5 @@ --- title: "Frames: ContentFrame and Panel" -unlisted: true hide_table_of_contents: false sidebar_label: Frames --- diff --git a/templates/guide-cta-footer.mdx b/templates/guide-cta-footer.mdx index 8db5e8cbf8..6a084d52ce 100644 --- a/templates/guide-cta-footer.mdx +++ b/templates/guide-cta-footer.mdx @@ -1,6 +1,5 @@ --- title: "Guide CTA footer" -unlisted: true hide_table_of_contents: false sidebar_label: CTA footer see_also: diff --git a/templates/home.mdx b/templates/home.mdx index 46a54c9b1a..8d174f3a7f 100644 --- a/templates/home.mdx +++ b/templates/home.mdx @@ -3,7 +3,6 @@ slug: / pagination_next: null pagination_prev: null title: "Documentation Templates" -unlisted: true --- # Documentation Templates diff --git a/templates/icon-gallery.mdx b/templates/icon-gallery.mdx index e575b1fa12..dd3391a16a 100644 --- a/templates/icon-gallery.mdx +++ b/templates/icon-gallery.mdx @@ -1,6 +1,5 @@ --- title: "Icon Gallery" -unlisted: true hide_table_of_contents: false sidebar_label: Icon Gallery see_also: diff --git a/templates/introduction.mdx b/templates/introduction.mdx index 5db290c851..ac6233ed75 100644 --- a/templates/introduction.mdx +++ b/templates/introduction.mdx @@ -1,6 +1,5 @@ --- title: "Start template" -unlisted: true hide_table_of_contents: true sidebar_label: Start template --- diff --git a/templates/new-guides.mdx b/templates/new-guides.mdx index d07c28e0c4..4cc8a32824 100644 --- a/templates/new-guides.mdx +++ b/templates/new-guides.mdx @@ -1,6 +1,5 @@ --- title: "Adding new guides" -unlisted: true hide_table_of_contents: false sidebar_label: Adding new guides see_also: diff --git a/templates/see-also.mdx b/templates/see-also.mdx index b9e36d8667..8b7b3fade2 100644 --- a/templates/see-also.mdx +++ b/templates/see-also.mdx @@ -1,6 +1,5 @@ --- title: "See also" -unlisted: true hide_table_of_contents: false sidebar_label: See also --- diff --git a/templates/tags.mdx b/templates/tags.mdx index 2bfa7a02ef..7853b2c5a2 100644 --- a/templates/tags.mdx +++ b/templates/tags.mdx @@ -1,6 +1,5 @@ --- title: "Tags" -unlisted: true hide_table_of_contents: false sidebar_label: Tags see_also: diff --git a/templates/themed-images.mdx b/templates/themed-images.mdx index 989cc95019..ae6b63c977 100644 --- a/templates/themed-images.mdx +++ b/templates/themed-images.mdx @@ -1,6 +1,5 @@ --- title: "Themed Images" -unlisted: true hide_table_of_contents: false sidebar_label: Themed Images --- diff --git a/templates/video.mdx b/templates/video.mdx index 8c9de5299c..ef6216ccd4 100644 --- a/templates/video.mdx +++ b/templates/video.mdx @@ -1,6 +1,5 @@ --- title: "Video" -unlisted: true hide_table_of_contents: false sidebar_label: Video ---