Skip to content

fix(website): fit meta descriptions to the search-snippet budget - #880

Merged
blove merged 1 commit into
mainfrom
blove/docs-meta-descriptions
Aug 30, 2026
Merged

fix(website): fit meta descriptions to the search-snippet budget#880
blove merged 1 commit into
mainfrom
blove/docs-meta-descriptions

Conversation

@blove

@blove blove commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Summary

GSC follow-up to #826 (the pending CTR fix): meta descriptions over ~160 chars get re-truncated by Google mid-sentence with its own ellipsis, and the docs fallback path hard-sliced the first paragraph at 177 chars mid-word with ....

  • clampMetaDescription in site-metadata.ts: ≤160 chars, prefers ending on a sentence boundary once past 60% of the budget, otherwise cuts at a word boundary with a real . Never cuts mid-word.
  • Applied centrally in createPageMetadata (every page's meta/OG description) and at the docs/blog description sources, so each page's JSON-LD stays byte-identical to its meta description (a docs spec asserts that identity).
  • The docs extracted-paragraph path (111 of 130 pages have no frontmatter description) now uses the clamp.
  • Hand-rewrote the 5 over-budget blog descriptions and the pricing page description so author-chosen copy fits without machine clamping — the clamp immediately caught the pricing page losing its "$29 per developer per month" claim, which its spec asserts.
  • Specs: clamp unit tests; a docs sweep (every page ≤160, no legacy ..., guarded against passing vacuously on an empty slug list); a real-content blog frontmatter gate in site-metadata.spec.ts (placed there because blog.spec.ts mocks fs).

Verification

Runtime sweep across all 130 docs pages: max description length exactly 160, all cuts on word boundaries, zero legacy ... endings. nx test website green (371 passing), lint 0 errors, production build green.

🤖 Generated with Claude Code

@vercel

vercel Bot commented Aug 30, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
threadplane Canceled Canceled Aug 30, 2026 10:11pm

Request Review

@blove
blove enabled auto-merge (squash) August 30, 2026 22:06

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated approval: this PR received an intelligent (AI) code review. See the review comments on this PR.

@github-actions

github-actions Bot commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Claude finished @blove's task in 0s —— View job


I'll analyze this and get back to you.

GSC follow-up to #826: descriptions over ~160 chars get re-truncated by
Google mid-sentence, and the docs fallback path hard-sliced the first
paragraph at 177 chars mid-word with '...'.

- New clampMetaDescription in site-metadata.ts: ≤160 chars, prefers a
  sentence boundary past 60% of the budget, otherwise cuts at a word
  boundary with a real ellipsis. Applied centrally in createPageMetadata
  and at the docs/blog description sources so each page's JSON-LD stays
  byte-identical to its meta description.
- Docs extracted-paragraph path now uses the clamp (no more mid-word
  '...' cuts on the 111 pages without frontmatter descriptions).
- Rewrote the 5 over-budget blog descriptions and the pricing page
  description by hand so the author-chosen copy fits without clamping.
- Specs: clamp unit tests, a docs sweep (every page ≤160, no legacy
  '...', guarded against an empty slug list), and a real-content blog
  frontmatter gate in site-metadata.spec.ts (blog.spec.ts mocks fs).

The clamp immediately caught the pricing page description losing its
'$29 per developer per month' claim — shortened at the source instead.

nx test green (371 passing), lint 0 errors, production build green.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@blove
blove force-pushed the blove/docs-meta-descriptions branch from 60b0937 to 2aef07b Compare August 30, 2026 22:06
@github-actions

github-actions Bot commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Claude finished @blove's task in 0s —— View job


I'll analyze this and get back to you.

@blove
blove merged commit ef9ae71 into main Aug 30, 2026
23 checks 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.

1 participant