Skip to content

fix(docs): derive missing titles from Markdown headings - #1474

Open
tannerlinsley wants to merge 1 commit into
mainfrom
taren/docs-heading-title
Open

tannerlinsley wants to merge 1 commit into
mainfrom
taren/docs-heading-title

Conversation

@tannerlinsley

Copy link
Copy Markdown
Member

A healthy guide without a frontmatter title currently gets a visible “Content temporarily unavailable” heading and the same error text in its page title, even while its full Markdown body renders. This is reproducible on /router/latest/docs/how-to/setup-testing, whose upstream document starts with an H1 and has no frontmatter.

Preserve explicit frontmatter titles, otherwise derive the title from an H1 using the existing site Markdown parser. Documents with no H1 use “Documentation”; genuine temporary-unavailable fallback Markdown keeps its unavailable heading. This avoids mistaking headings inside code fences for page titles and handles inline formatting.

Focused tests cover explicit titles, missing metadata, formatted headings, fenced examples, genuine fallback content and documents without headings. The production response was captured before the fix. Full preview verification is pending. This addresses one cause of unhealthy metadata under #1153, which remains open for the broader sitemap contract.

Normal commit hooks passed formatting, TypeScript, lint, 689 unit tests, 2,278 chat tests and 20 desktop tests, with 5, 6 and 1 skipped respectively.

@tannerlinsley
tannerlinsley requested a review from a team November 1, 2026 05:37
@changeset-bot

changeset-bot Bot commented Nov 1, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 0b6deeb

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai

coderabbitai Bot commented Nov 1, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 9 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e2e3e4f6-7739-4228-a726-4b3f659e6de1
Commits

Reviewing files that changed from the base of the PR and between 5e9bb6d and 0b6deeb.

Files selected for processing: 3
  • src/utils/docs-title.ts
  • src/utils/docs.functions.ts
  • tests/docs-title.test.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
tanstack-com 0b6deeb Commit Preview URL

Branch Preview URL
Nov 01 2026, 05:39 AM

@tannerlinsley

Copy link
Copy Markdown
Member Author

The real guide title now appears on the exact commit preview.

AI review notes:
On 0b6deeb, https://516017d1-tanstack-com.thetanstack.workers.dev/router/latest/docs/how-to/setup-testing returned HTTP 200 with the title “How to Set Up Testing with Code-Based Routing | TanStack Router Docs”, its matching production canonical, and no “Content temporarily unavailable” text. The guide body still renders. Local tests separately cover explicit metadata, formatted headings, fenced examples and genuine unavailable fallback content. Required team review remains outstanding; this is not a production claim.

@tannerlinsley

Copy link
Copy Markdown
Member Author

The broader preview check also clears the remaining public-document title failures from the earlier sitemap audit.

AI review notes:
Checked all 10 remaining document URLs after separating contributing notes and the internal Devtools specification. On the exact 0b6deeb preview, each returns HTTP 200 with a matching production canonical and no unavailable/error heading. Preview responses carry the host's noindex header, so this is not a production indexing pass.

Nine pages get their Markdown heading as the title. The Svelte migration guide uses the generic Documentation fallback because its upstream file has neither title metadata nor an H1; its 2,737-byte source contains the actual migration guide, so it should remain available rather than being treated as a missing page. Required team review still applies.

This branch has not been deployed

No deployments
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