Skip to content

Fix Multiple H1 tags across docs pages (SEO)#73

Open
shivthakker wants to merge 1 commit into
mainfrom
seo-docs-single-h1
Open

Fix Multiple H1 tags across docs pages (SEO)#73
shivthakker wants to merge 1 commit into
mainfrom
seo-docs-single-h1

Conversation

@shivthakker

Copy link
Copy Markdown
Member

Summary

Ahrefs flagged 318 pages with multiple <h1> tags — the single largest issue in the audit, and almost entirely the docs. Multiple H1s dilute the primary heading signal for search engines. This PR makes every docs page render exactly one <h1> (the page title).

Root cause

Docs pages had two competing H1 patterns:

  • Leaf pages rendered the frontmatter title via <DocsTitle> (an <h1>) and repeated it as a leading # Heading in the MDX body → 2 H1s.
  • Section overview pages did the opposite — the isOverviewPage guard skipped <DocsTitle>, so they relied on the body # Heading as their only h1.

Fix (deterministic — one <h1> per page)

  1. Stripped the duplicate leading # Heading from 346 hand-written docs MDX bodies. The auto-generated API docs (content/docs/api/*) were already clean (they use <ResourceHeader> / ##), so they're untouched and the generator needs no change.
  2. Render <DocsTitle>/<DocsDescription> unconditionally in all 9 docs section templates (removed the isOverviewPage guard) — so overview pages keep an <h1> now that the body heading is gone, and every page is consistent.

Net: 346 MDX + 9 page.tsx, −747 lines (mostly removed duplicate headings).

Verification

Confirmed on a fresh dev server that the /docs landing, section overviews, and leaf pages across platform, fleet-ops, storefront, cli, ledger, and ui all render exactly one <h1> containing the page title (e.g. <h1>Fleet-Ops</h1>, <h1>Orders Overview</h1>).

Note for reviewers

  • Overview/landing pages now show the title via the standard DocsTitle component (with the frontmatter description as a subtitle) instead of an inline # heading — a small, consistent visual change that aligns them with every other docs page.
  • A full next build wasn't run locally because the blog needs Ghost API keys; the docs changes were verified via live render. The Vercel preview will exercise the full build.

🤖 Generated with Claude Code

Ahrefs flagged 318 pages with multiple <h1> tags — almost all docs pages.
Root cause: every docs leaf page rendered the frontmatter title via
<DocsTitle> (an <h1>) AND repeated it as a leading `# Heading` in the MDX
body (a second <h1>). Section overview pages did the inverse — they
skipped <DocsTitle> and relied on the body `# Heading` as their only h1.

Fix (deterministic — exactly one <h1> per page):
- Strip the duplicate leading `# Heading` from 346 hand-written docs MDX
  bodies. The auto-generated API docs were already clean (no change).
- Render <DocsTitle>/<DocsDescription> unconditionally in all 9 docs
  section templates (removed the isOverviewPage guard), so overview pages
  keep an <h1> now that the body heading is gone.

Verified on a fresh dev server: /docs landing, section overviews, and
leaf pages across platform, fleet-ops, storefront, cli, ledger, and ui
all render exactly one <h1> containing the page title.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
fleetbase-io Ready Ready Preview, Comment Jun 15, 2026 12:24pm

Request Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant