Skip to content

docs: remove duplicate page title from every MDX body#45

Merged
os-zhuang merged 1 commit into
mainfrom
claude/session-uty9w1
Jul 17, 2026
Merged

docs: remove duplicate page title from every MDX body#45
os-zhuang merged 1 commit into
mainfrom
claude/session-uty9w1

Conversation

@os-zhuang

Copy link
Copy Markdown
Contributor

What

Fixes the doc-site issue where every page's title rendered twice.

The docs page renderer (app/[lang]/docs/[[...slug]]/page.tsx) already prints the frontmatter title via <DocsTitle> (with the description subtitle and Copy-Markdown / Open buttons). Each content file also opened its body with a # Title H1 that matched the frontmatter title, so the title appeared a second time right below the header.

Changes

  • Strip the leading # Title H1 from all 406 content MDX files (English + all locales). The frontmatter title remains the single source of truth — it's what <DocsTitle>, the sidebar, and the browser tab already use.
  • Side benefit: the "On this page" table of contents no longer lists the page title itself as its first entry.

The 15 files whose body H1 differed cosmetically from the frontmatter title (e.g. `skills` CLI vs skills CLI, 岗位(Positions) vs 岗位) now show the canonical frontmatter title, matching what the sidebar already displayed.

Verification

  • npm run type-check and npm run build pass (740 pages)
  • Browser-checked: exactly one H1 per page now (English /docs/use and zh-Hans positions page both show a single title); header layout and TOC render correctly

🤖 Generated with Claude Code

https://claude.ai/code/session_0145MY7RdJr8KuRMyn5oKAR6


Generated by Claude Code

The docs renderer already prints the frontmatter title via <DocsTitle>,
so the leading '# Title' H1 in each content file rendered the title a
second time. Strip that H1 from all pages (English + translations); the
frontmatter title remains the single source, and the on-this-page TOC
no longer lists the title itself.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0145MY7RdJr8KuRMyn5oKAR6
@os-zhuang
os-zhuang merged commit 095c113 into main Jul 17, 2026
1 check passed
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.

2 participants