Skip to content

Opt-in structured data for provider microsites: withStructuredData and check-site - #6

Merged
jeffreyaven merged 1 commit into
mainfrom
feature/structured-data
Nov 23, 2026
Merged

jeffreyaven merged 1 commit into
mainfrom
feature/structured-data

Conversation

@jeffreyaven

Copy link
Copy Markdown
Member

Part B of the provider-microsite structured-data pilot. Adds an opt-in withStructuredData() export that holds the settings, plus a verification script. createConfig output is unchanged, and no site calls the new export until the homebrew and cloudflare pilot PRs land.

Needs @stackql/docusaurus-plugin-structured-data 1.9.0 (stackql-labs/docusaurus-plugin-structured-data#5) for the Organization @id to reach every publisher.

Work order coverage

Item Status
1. providerIds(providerName) -> { providerSlug, providerRepo }, used by both functions Done.
2. withStructuredData(config, { providerName, providerTitle }): plugin appended by name, themeConfig.structuredData set, hand-written SoftwareApplication head tag removed by parsed @type, showLastUpdateTime = true Done. Nested objects it changes (plugins, headTags, presets[0], themeConfig) are replaced rather than mutated in place, so nothing shared is touched.
3. Throw if the plugin is already registered or presets[0] is not the classic preset Done. Also throws if themeConfig.structuredData is already set or the preset has docs: false.
4. README: "Structured data" section and a line under "What lives here" Done.
5. scripts/structured-data/check-site.mjs Done. See below.
6a. menu-sync check on the branch Could not be dispatched: the workflow is disabled in this repo (HTTP 422). Re-enabling it also re-arms the daily sync schedule, so I left that to you. I ran the same three gates locally against this branch instead, see Validation.
6b. createConfig() same as main Done, for all 42 providers in catalog/last-known-good.json, JSON compare with functions replaced by their names: 0 differ.

Values confirmed

  • Organization: @id https://stackql.io/#organization, name StackQL, url https://stackql.io, logo (the full ImageObject with stackql.io's #logo @id, 512x512) and the five sameAs links. Taken from stackql.io's main config and checked against the Organization node in the live https://stackql.io/ HTML; they match. contactPoint, address and taxID are left to stackql.io's own node.
  • license on softwareSourceCode: left out. The 33 provider repos in the catalog are not all under the same licence: MIT for most, Apache-2.0 for aws, cloudflare and databricks, none for awscc, NOASSERTION for snowflake.
  • All 33 provider repos are public.
  • excludedRoutes is redirectRoutes(config.baseUrl || '/') rather than the literal '/'. The result is the same on every microsite.

check-site.mjs

Input is a build directory or a list of URLs (--sitemap adds every sitemap URL; the redirect stubs and /404.html of each origin are added unless --no-stubs). Matches type=application/ld+json quoted or not. The plugin's block is the one without data-rh whose JSON is an @graph with a WebPage. A docs page is recognised by the docs-doc-page class on <html>. Checks every per-page acceptance criterion; across pages, it fails when dateModified is the same on every page and, with --git <docs dir>, compares three sampled doc pages with git log -1 --format=%cI. Duplicate descriptions are a warning. Exit 0/1/2.

One judgement call: WebSite.potentialAction: [] (what the settings block sets) counts as "no potentialAction". An empty array is no value in JSON-LD, and it is the plugin's documented way to drop the SearchAction.

Validation

  • createConfig equivalence: 42/42 identical to main.
  • withStructuredData assertions (scratch script, not committed: this repo has no test runner): plugin appended, head tag removed by @type wherever it sits and unrelated JSON-LD kept, preset and the rest of themeConfig untouched, no shared nested objects between calls, every error path.
  • menu-sync gates, run locally on this branch: plausible.mjs passes against today's catalog (44 providers, ovh and nvidia added); preflight replica (typesafe cloned, this checkout vendored, docusaurus build against the catalog, then compare.mjs) passes with 44 providers found, still on the plain createConfig path; check-fleet.mjs runs with 0 errors. It reports all 44 live sites drifted because the catalog gained nvidia, ovh and supabase and nothing has redeployed since the workflow was disabled. That is unrelated to this branch.
  • check-site.mjs on a homebrew build with this branch and plugin 1.9.0: all 28 pages pass (11 processed, 16 stubs, 404), and the git dates match for 3 of 3. On the pre-change homebrew build, all 28 fail, including the minified pages. Each failure path was also exercised by mutating real built pages (wrong org id, SearchAction, canonical mismatch, plugin breadcrumb, missing native breadcrumb, SoftwareApplication not mainEntity, missing TechArticle, plugin block on a stub, two plugin blocks, broken JSON, identical dates, git mismatch).

Found while testing, now in the README: on Windows, Docusaurus 3.10's eager git lookup (future.faster) misses every file when the cwd's drive letter is lower case, so every page gets the build time as dateModified. Linux runners are not affected.

🤖 Generated with Claude Code

…d check-site

withStructuredData(config, { providerName, providerTitle }) wraps a
createConfig result: registers @stackql/docusaurus-plugin-structured-data
by name (resolved from the site's node_modules; this module still imports
nothing), sets themeConfig.structuredData (stackql.io's Organization by
@id, SoftwareSourceCode, SoftwareApplication defaults, TechArticle on the
default docs instance, native BreadcrumbList reused, redirect stubs
excluded, no SearchAction), removes the hand-written SoftwareApplication
head tag by its @type, and turns on showLastUpdateTime. Throws rather than
registering the plugin twice or wrapping a non-classic preset.

The slug and repo derivation moves into providerIds(), shared by both
functions. createConfig output is unchanged (JSON compare against main
for all 42 catalog providers).

scripts/structured-data/check-site.mjs checks a build directory or live
URLs against the pilot's acceptance criteria and prints a per-page table.

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