freestruct docs

freestruct v1.1.0

freestruct is a post-build SEO layer for static doc sites. v1.1.0 is the first post-stable release: a suite of new surface that includes the entire issue sweep and the SEO-gap pass, everything battery-pinned. This post ships with the v1.1.0 tag: npm has the tarball by the time you read it:

npm i -D freestruct

What landed

Three groups of work, in one release.

The verification layer. freestruct audit verifies a BAKED output tree independently of the run that produced it, so it works after any SSG’s build: per-page head hygiene (titles, descriptions, absolute canonicals, the core og/twitter set, the SVG share-preview trap, JSON-LD parse checks, h1 sanity), the 404 noindex contract, and the sitemap/robots artifacts. It prints a human report, prints a --json digest for CI annotations, and exits 1 on FAIL findings. Duplicated tags now ride the FAIL class too - a double canonical or double og:title is always consumer-caused (missing-only injection cannot duplicate), so the audit names it instead of grading around it. A failing hooks.postBuild command now also fails the build with the documented exit code 4.

The consumer surface. og.image takes the structured { src, width, height, alt } form and ships its companion tags; SVG sources warn loudly and fail under --strict, because a broken share preview is worse than no tag. A slug-glob scoped config form now keys blocks per page: jsonLd, og.scoped and article.scoped all take exact keys (/faq), one-segment globs (/blog/*) and sub-tree globs (/guides/**), most specific first. ogImageGeneration renders a branded 1200x630 PNG per page from a consumer SVG template (opt-in through the optional @resvg/resvg-js rasterizer). IndexNow support ships end to end: indexNow: true emits the keyLocation ownership file during the run, and freestruct indexnow POSTs the baked sitemap to the API after deploy (--dry-run first, of course).

The SEO-gap pass. Eight additions that finish the modern head, all opt-in, all missing-only:

Config

Still one file, docs/freestruct.config.yml. The two required lines are unchanged; the new keys slot in beside them:

# docs/freestruct.config.yml
site:
  name: My Docs
  url: https://example.com/docs
  description: Documentation for my project

# Discovery options - opt-in, missing-only, loudly diagnostic:
search:
  url: https://example.com/search?q={search_term_string}
breadcrumb: true
verification:
  google: goog-code-123
locales:
  "/": en
  "/de/**": de
llms: true

Wrong-shaped values warn at load with the named fix and the run stays honest: a placeholder-less search URL ships no SearchAction, a list where one image belongs ships no image, and an unknown section title passes through with a config warning line.

The CLI

npx freestruct            # the full post-build pass
npx freestruct validate   # config-only preflight
npx freestruct audit      # verify the baked output; --json, --external
npx freestruct indexnow   # post-deploy search-engine notify
npx freestruct init       # scaffold the starter kit
npx freestruct --strict   # broken links + SVG og:image fail the CI build

Exit codes remain part of the contract: 0 ok, 1 config fatal, 2 template missing, 3 output dir missing, 4 hook failure.

Quality layer

The fixture battery grew from 49 pins at the 1.0.0 sweep’s start to 103 now, with red-checked additions per change and the hunt passes that found and fixed the noindex-junk and line-flattening classes before any release. Post-draft hardening sweeps walked the untouched engine corners and shipped what they caught, all pinned: the missing-only gates became tag-anchored (a page quoting application/ld+json in its own prose can no longer silence its structured-data injection), a consumer basePath with a trailing slash no longer doubles every injected URL, a file at the outputDir path fails as a named error instead of a stack dump, headless .html fragments name themselves on the run rather than silently skipping injection, .htm and mixed-case extensions join the full pipeline, the link checker resolves pretty-URL routes (directory index and .htm sibling shapes, root-relative hrefs on nested pages), and the breadcrumb trail coexists with any config jsonLd form - our own docs shipped exactly that footgun live. The last sweeps closed two quiet-mistake classes outright: the injector now refuses to walk an SSG source tree (a wrong positional could stamp build meta into committed templates, silently), and a typo’d CLI flag fails loudly instead of riding as an output directory; the audit also stops repeating the twitter absence rows for teams without a configured handle. CI runs the standard gates (docs audit with seven gates, template sync lockstep, tarball e2e), plus crashtest two ways: the pack selftest proves the attack surface holds, and the docs deploy dogfoods a second campaign against the freshly built site. Packstruct’s manifest lint holds the /packs spec from drifting. All of it runs on every push and PR.