Skip to content

v0.8.0: per-page front matter descriptions - #6

Open
jeffreyaven wants to merge 1 commit into
mainfrom
feature/per-page-descriptions
Open

jeffreyaven wants to merge 1 commit into
mainfrom
feature/per-page-descriptions

Conversation

@jeffreyaven

@jeffreyaven jeffreyaven commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Part D of the provider-microsite structured-data pilot. Every generated resource and service page had the same front matter description: (Query, deploy and manage <provider> resources using SQL), so the meta description and WebPage.description repeated across a whole site.

Work order coverage

Item Status
1. Resource pages (v1 and v2): from resourceDescription, HTML tags and Markdown links stripped, whitespace collapsed, first sentence, 160 characters on a word boundary, fallback to the current string Done. metaDescription(text, fallback) in src/docgen/helpers.js, used by createOverviewSection and createOverviewSectionv2. Also: link text is kept, inline code backticks and ** are dropped, entities are decoded, the first-sentence split skips e.g./i.e./etc. and periods inside tokens (Node.js, v1.2), and a cut ends in ... within the 160 characters.
2. Service index pages: Query, deploy and manage <provider> <service> resources using SQL Done (generator.js, shared by v1 and v2).
3. YAML-safe via JSON.stringify Done for every description docgen writes (yamlString).
4. Provider index untouched Yes. The test asserts it keeps headerContent1.txt's value.
5. Tests (jest, homebrew fixture, both generators) tests/docgen/descriptions.test.js: descriptions differ per resource; values with a colon, quotes, a newline, # and HTML still parse with js-yaml; the fallback applies for an empty and a missing description; plus unit tests for metaDescription and yamlString.
6. CHANGELOG, docs/docgen.md, 0.8.0 Done. Publishing is for Jeff.

For review: the fallback leaves both pilots short of unique descriptions

The fallback is the provider-wide string, as the work order specifies. Few provider specs carry resource descriptions:

  • homebrew: the published provider the site is generated from has a description on none of its 9 documented resources (the test fixture's vw_info description is not in it), so every resource page keeps the fallback. Only the service index page changes.
  • cloudflare: 0 of 1,127 resources have one, so every resource page keeps the fallback. Only the 108 service index pages become distinct.

So the pilot criterion "WebPage.description is unique across resource pages" cannot pass on either site with this PR alone. A per-resource fallback would fix that, for example Query, deploy and manage the <resource> resource in the <provider> <service> service using SQL. It's a one-line change in resourcePageDescription (overview.js); I left it out because it departs from the work order.

Validation

  • npm test: 107 passed (96 before, 11 added).
  • Regenerating homebrew from its published provider with this branch changes 10 files, the description: line only: 9 resource pages (same text, now quoted) and the service index (now names the service).

🤖 Generated with Claude Code

Resource pages take the first sentence of the resource description (HTML
tags and Markdown links stripped, backticks dropped, entities decoded,
whitespace collapsed, capped at 160 characters on a word boundary), and
fall back to the former provider-wide string when there is none. Service
index pages name the service. The provider index keeps headerContent1.txt.
Values are emitted as YAML double-quoted scalars (JSON.stringify).

Regenerated output changes for every provider, hence 0.8.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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