Skip to content

fix(seo): library-specific meta descriptions on implementation pages - #11203

Merged
MarkusNeusinger merged 3 commits into
mainfrom
feat/seo-library-specific-meta-descriptions
Sep 2, 2026
Merged

fix(seo): library-specific meta descriptions on implementation pages#11203
MarkusNeusinger merged 3 commits into
mainfrom
feat/seo-library-specific-meta-descriptions

Conversation

@MarkusNeusinger

Copy link
Copy Markdown
Owner

Summary

  • Bing Webmaster Tools flags "too many pages with identical meta descriptions": the SEO proxy used the spec description verbatim as <meta name="description"> / og:description on every implementation page, so the up to 15 library pages of a spec and its hub shared one snippet. A 43-page sample as Bingbot had 32 distinct descriptions; catalogue-wide, 4,254 plot pages carry about 334.
  • _build_impl_html now builds the snippet as {title} in {library} ({language}): {spec description} before the existing 155-character trim, so every page is unique and a searcher who typed "matplotlib funnel chart" sees the library in the result. The hub page keeps the plain description; body copy and JSON-LD are unchanged.
  • Unit test asserts two libraries of one spec get different, library-named descriptions; docs/reference/seo.md documents the rule.

Plan

N/A

Test plan

  • ruff format / ruff check clean; tests/unit/api/test_seo_helpers.py 63 passed.
  • After the API deploy: curl -A bingbot https://anyplot.ai/funnel-basic/python/matplotlib and .../python/seaborn show different descriptions starting with the page title and library.

🤖 Generated with Claude Code

https://claude.ai/code/session_01SrKzcwZBnref1sWYtdXynu

The SEO proxy reused the spec description verbatim as the meta/OG
description of every implementation page, so up to 15 library pages and
their hub carried an identical snippet — 4,254 plot pages had about 334
distinct descriptions, which Bing Webmaster Tools flagged. The snippet now
opens with "{title} in {library} ({language}): " before the description,
trimmed to 155 characters as before. Hub, body copy and JSON-LD unchanged.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SrKzcwZBnref1sWYtdXynu
Copilot AI lite review requested due to automatic review settings September 2, 2026 17:38

Copilot AI 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.

🟢 Approval recommended

The production change is localized and consistent with existing escaping/trimming behavior, and it includes test + documentation + changelog updates (only minor test robustness nits noted).

Pull request overview

This PR updates the SEO bot-page renderer so implementation pages use library-specific meta/OG descriptions (reducing duplicate snippets across the 15-per-spec implementation pages), while keeping the spec hub description unchanged.

Changes:

  • Build implementation-page <meta name="description"> / og:description as {title} in {library} ({language}): {spec description}, still trimmed to 155 characters.
  • Add a unit test asserting different libraries for the same spec produce different meta descriptions.
  • Document the meta description rule in docs/reference/seo.md and add a changelog entry.
File summaries
File Description
api/routers/seo.py Prefixes implementation-page meta/OG descriptions with title + library + language to make snippets unique per implementation page.
tests/unit/api/test_seo_helpers.py Adds a unit test covering the new library-specific meta description behavior.
docs/reference/seo.md Documents the meta description trimming and the implementation-page prefix rule.
CHANGELOG.md Records the SEO fix under [Unreleased].
Review details
  • Files reviewed: 4/4 changed files
  • Comments generated: 2
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread tests/unit/api/test_seo_helpers.py Outdated
Comment thread tests/unit/api/test_seo_helpers.py
Review feedback: guard re.search() before .group() and check the escaped
<p>…</p> body instead of a substring that JSON-LD also carries.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SrKzcwZBnref1sWYtdXynu
Copilot AI review requested due to automatic review settings September 2, 2026 17:44

Copilot AI 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.

🔵 Needs a closer look

The new [Unreleased] changelog bullet is missing the required PR reference suffix (e.g. “(#NNNN)”).

Review details

Suppressed comments (1)

Previously missed (1) — in code that hasn't changed since the last review.

CHANGELOG.md:35

  • This new changelog entry is missing the PR reference suffix (e.g. "(#11199)") that the changelog header requires for every bullet under [Unreleased]. Please append this PR's number to the end of the bullet for consistency and traceability.
  • Files reviewed: 4/4 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

@codecov

codecov Bot commented Sep 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SrKzcwZBnref1sWYtdXynu
Copilot AI review requested due to automatic review settings September 2, 2026 17:54

Copilot AI 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.

🟢 Approval recommended

The change is narrowly scoped, matches the PR description, includes a focused regression test, and updates both documentation and the changelog.

Review details
  • Files reviewed: 4/4 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

@MarkusNeusinger
MarkusNeusinger merged commit 1e17f77 into main Sep 2, 2026
8 checks passed
@MarkusNeusinger
MarkusNeusinger deleted the feat/seo-library-specific-meta-descriptions branch September 2, 2026 18:01
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