Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 `<body>`. 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).

---

Expand Down
3 changes: 3 additions & 0 deletions docusaurus.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 } },
},
],
[
Expand Down
11 changes: 0 additions & 11 deletions src/theme/DocItem/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,13 @@ 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<typeof DocItemType>;

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/") ||
Expand All @@ -31,15 +27,8 @@ export default function DocItemWrapper(props: Props): ReactNode {

const showTopbar = Boolean(isDocsOrVersioned && !isExcluded);

const isTemplatesPlugin = pluginId === "templates";

return (
<SupportedLanguagesContext.Provider value={supportedLanguages}>
{isTemplatesPlugin && (
<Head>
<meta name="robots" content="noindex, nofollow" />
</Head>
)}
{supportedLanguages?.length ? <LanguageUrlSync supportedLanguages={supportedLanguages} /> : null}
{showTopbar && <DocsTopbar title={title} supportedLanguages={supportedLanguages} />}
<div className="wrapper row">
Expand Down
1 change: 0 additions & 1 deletion templates/authors.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
title: "Authors"
unlisted: true
hide_table_of_contents: false
sidebar_label: Authors
see_also:
Expand Down
1 change: 0 additions & 1 deletion templates/featured-guides.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
title: "Featured guides"
unlisted: true
hide_table_of_contents: false
sidebar_label: Featured guides
see_also:
Expand Down
1 change: 0 additions & 1 deletion templates/frames.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
title: "Frames: ContentFrame and Panel"
unlisted: true
hide_table_of_contents: false
sidebar_label: Frames
---
Expand Down
1 change: 0 additions & 1 deletion templates/guide-cta-footer.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
title: "Guide CTA footer"
unlisted: true
hide_table_of_contents: false
sidebar_label: CTA footer
see_also:
Expand Down
1 change: 0 additions & 1 deletion templates/home.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ slug: /
pagination_next: null
pagination_prev: null
title: "Documentation Templates"
unlisted: true
---

# Documentation Templates
Expand Down
1 change: 0 additions & 1 deletion templates/icon-gallery.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
title: "Icon Gallery"
unlisted: true
hide_table_of_contents: false
sidebar_label: Icon Gallery
see_also:
Expand Down
1 change: 0 additions & 1 deletion templates/introduction.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
title: "Start template"
unlisted: true
hide_table_of_contents: true
sidebar_label: Start template
---
Expand Down
1 change: 0 additions & 1 deletion templates/new-guides.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
title: "Adding new guides"
unlisted: true
hide_table_of_contents: false
sidebar_label: Adding new guides
see_also:
Expand Down
1 change: 0 additions & 1 deletion templates/see-also.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
title: "See also"
unlisted: true
hide_table_of_contents: false
sidebar_label: See also
---
Expand Down
1 change: 0 additions & 1 deletion templates/tags.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
title: "Tags"
unlisted: true
hide_table_of_contents: false
sidebar_label: Tags
see_also:
Expand Down
1 change: 0 additions & 1 deletion templates/themed-images.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
title: "Themed Images"
unlisted: true
hide_table_of_contents: false
sidebar_label: Themed Images
---
Expand Down
1 change: 0 additions & 1 deletion templates/video.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
title: "Video"
unlisted: true
hide_table_of_contents: false
sidebar_label: Video
---
Expand Down
Loading