Skip to content

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

Merged
jeffreyaven merged 3 commits into
mainfrom
feature/per-page-descriptions
Nov 23, 2026
Merged

jeffreyaven merged 3 commits 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 per resource (decision below) 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.

Fallback (decided)

Resource pages never get the provider-wide string. When the resource description yields no sentence, the page gets Query, deploy and manage the <resource> resource in the <provider> <service> service using SQL (resourceFallbackDescription in overview.js). Few provider specs carry resource descriptions (homebrew 0 of 9, cloudflare 0 of 1,127), so with the provider-wide fallback almost every resource page repeated one description. The fallback is not capped at 160 characters, since cutting it could make two pages collide again; the JSDoc says so.

Validation

  • npm test: 110 passed (96 before, 14 added). The per-resource fallback tests fail against the provider-wide fallback (6 failures) and pass on this branch.
  • Both pilots regenerated with this branch through their own docgen pipelines, built as CI does (docusaurus-config main vendored), and checked with check-site.mjs --git. Both pass, and the duplicate-description warning is gone:
Site Files changed by regeneration Resource pages Service pages All processed pages Longest
homebrew 10 (description: line only) 9 distinct / 9 1 / 1 11 / 11 96 chars
cloudflare 1,235 (description: line only) 1,127 distinct / 1,127 108 / 108 1,236 / 1,236 135 chars

No resource page on either site carries the provider-wide line. The regenerated docs were not committed to the sites; that happens on their next regeneration with 0.8.0.

  • Review fixes after the regeneration: surrogate code-point entities are no longer decoded, and the JSDoc says the fallback is uncapped. Neither changes output for these two sites, whose specs have no resource descriptions.

🤖 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>
jeffreyaven and others added 2 commits November 23, 2026 18:17
A resource page whose resource description yields no sentence gets
"Query, deploy and manage the <resource> resource in the <provider>
<service> service using SQL" instead of the provider-wide line, so no
resource page carries the provider-wide string and no two share one.
Few provider specs carry resource descriptions (homebrew 0 of 9,
cloudflare 0 of 1,127), so with the provider-wide fallback almost every
resource page repeated the same description.

Version stays 0.8.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Numeric entities for surrogate code points are left as written rather
than decoded to a lone surrogate. The JSDoc now says the fallback is
returned as given, uncapped, which is what the code does.

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