Repository navigation
Opt-in structured data for provider microsites: withStructuredData and check-site - #6
Merged
Merged
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part B of the provider-microsite structured-data pilot. Adds an opt-in
withStructuredData()export that holds the settings, plus a verification script.createConfigoutput is unchanged, and no site calls the new export until the homebrew and cloudflare pilot PRs land.Needs
@stackql/docusaurus-plugin-structured-data1.9.0 (stackql-labs/docusaurus-plugin-structured-data#5) for the Organization@idto reach everypublisher.Work order coverage
providerIds(providerName)->{ providerSlug, providerRepo }, used by both functionswithStructuredData(config, { providerName, providerTitle }): plugin appended by name,themeConfig.structuredDataset, hand-writtenSoftwareApplicationhead tag removed by parsed@type,showLastUpdateTime = trueplugins,headTags,presets[0],themeConfig) are replaced rather than mutated in place, so nothing shared is touched.presets[0]is not the classic presetthemeConfig.structuredDatais already set or the preset hasdocs: false.scripts/structured-data/check-site.mjscheckon the branchsyncschedule, so I left that to you. I ran the same three gates locally against this branch instead, see Validation.createConfig()same asmaincatalog/last-known-good.json, JSON compare with functions replaced by their names: 0 differ.Values confirmed
@idhttps://stackql.io/#organization,nameStackQL,urlhttps://stackql.io,logo(the fullImageObjectwith stackql.io's#logo@id, 512x512) and the fivesameAslinks. Taken from stackql.io'smainconfig and checked against the Organization node in the live https://stackql.io/ HTML; they match.contactPoint,addressandtaxIDare left to stackql.io's own node.licenseonsoftwareSourceCode: 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.excludedRoutesisredirectRoutes(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 (
--sitemapadds every sitemap URL; the redirect stubs and/404.htmlof each origin are added unless--no-stubs). Matchestype=application/ld+jsonquoted or not. The plugin's block is the one withoutdata-rhwhose JSON is an@graphwith aWebPage. A docs page is recognised by thedocs-doc-pageclass on<html>. Checks every per-page acceptance criterion; across pages, it fails whendateModifiedis the same on every page and, with--git <docs dir>, compares three sampled doc pages withgit 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 theSearchAction.Validation
createConfigequivalence: 42/42 identical tomain.withStructuredDataassertions (scratch script, not committed: this repo has no test runner): plugin appended, head tag removed by@typewherever it sits and unrelated JSON-LD kept, preset and the rest ofthemeConfiguntouched, no shared nested objects between calls, every error path.plausible.mjspasses against today's catalog (44 providers, ovh and nvidia added); preflight replica (typesafe cloned, this checkout vendored,docusaurus buildagainst the catalog, thencompare.mjs) passes with 44 providers found, still on the plaincreateConfigpath;check-fleet.mjsruns 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.mjson 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,SoftwareApplicationnotmainEntity, missingTechArticle, 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 asdateModified. Linux runners are not affected.🤖 Generated with Claude Code