Skip to content

fix(seo): social cards said "Home", not the page title - #127

Merged
imran-siddique merged 1 commit into
mainfrom
fix/social-card-title
Aug 21, 2026
Merged

fix(seo): social cards said "Home", not the page title#127
imran-siddique merged 1 commit into
mainfrom
fix/social-card-title

Conversation

@imran-siddique

Copy link
Copy Markdown
Member

MkDocs sets page.title from the nav entry when the nav gives one, so a landing page listed as - Home: index.md reports page.title == "Home" regardless of its front matter. The <title> tag was right, because Material reads the front matter for it. og:title and twitter:title read page.title, and shipped this to every link preview:

og:title = "Home - TRACE"

This one is mine. My earlier landing-page change relaxed the expression from page.title and not page.is_homepage to page.title, which turned a bare site-name fallback into "Home - X". Worse than what it replaced.

page.meta.title is the front-matter value, so prefer it, fall back to page.title for inner pages, then to the site name.

Verified per site

Before After
trace Home - TRACE Hardware-attested receipts for AI agent actions - TRACE
cmcp Home - cMCP The secure, confidential way to run MCP - cMCP
ca2a Home - cA2A Secure, confidential agent-to-agent delegation - cA2A
tests Home - TRACE Tests Verify your TRACE implementation - TRACE Tests

Homepage og:title now matches its <title>, and inner pages keep their own (Quick Start - cMCP). All four build clean under mkdocs build --strict.

Found by link-checking the live estate: the minified HTML uses unquoted attributes, which is why it did not show up in an earlier pass.

🤖 Generated with Claude Code

https://claude.ai/code/session_013EQx4N5BzTQbY8kvXUsdkY

MkDocs sets page.title from the nav entry when the nav gives one, so a
landing page listed as "- Home: index.md" reports page.title == "Home".
The <title> tag was right, because Material reads the front matter for
it, but og:title and twitter:title read page.title and shipped

    og:title = "Home - TRACE"

to every link preview. My own change introduced this: the previous
expression suppressed the homepage title entirely and fell back to the
site name, so the regression turned a bare "TRACE" into "Home - TRACE".

page.meta.title is the front-matter value. Prefer it, fall back to
page.title for inner pages, then to the site name.

Verified per site: the homepage og:title now matches its <title>, and
inner pages keep their own. Builds clean under --strict.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013EQx4N5BzTQbY8kvXUsdkY
@imran-siddique
imran-siddique requested a review from a team as a code owner August 21, 2026 04:36
@imran-siddique
imran-siddique merged commit b3bf6e2 into main Aug 21, 2026
12 checks passed
@imran-siddique
imran-siddique deleted the fix/social-card-title branch August 21, 2026 04:39
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