freestruct docs

Post-build SEO layer

Your docs deserve real SEO. One command after the build.

Freestruct runs after any static site generator - Jekyll, Hugo, Astro, you name it - and finishes the SEO every page still needs: complete meta, a real sitemap.xml, robots.txt, an RSS feed, a noindex 404.html, cache-busted assets and validated links. Your build stays untouched. No plugins, no template edits.

$npm i -D freestruct && npx freestruct
Jekyll Hugo Docusaurus MkDocs VitePress Astro Eleventy any HTML output
How it fits

Your SSG builds. Freestruct finishes.

A pure post-build layer - it reads the built HTML and writes SEO into it. No plugin to install into your generator, no template to touch, nothing to keep in sync with an SSG upgrade.

01

Any SSG

Jekyll, Hugo, Docusaurus, VitePress, MkDocs, Astro, Eleventy - your build, untouched.

02

Built tree

Plain HTML files in _site, public, build - whatever your SSG emits.

03

Freestruct

npx freestruct - one command, zero plugins, config discovered automatically.

04

SEO-grade tree

Meta, artifacts and validated links, fresh on every run and ready to deploy.

What lands on every page

Everything a page is still missing, nothing it already has

Injection is missing-only: what you already set stays yours. Nothing overwritten, nothing guessed.

Meta + canonical

Full search-engine armor - title, description, a self canonical, plus Open Graph, Twitter and JSON-LD blocks - added only where a page is missing them, so your own settings always win. </div> <div class="lp-card" markdown="1">

sitemap.xml

Every page, one entry, real per-page <lastmod> dates crawlers can trust - properly escaped XML. </div> <div class="lp-card" markdown="1">

robots.txt

Waves crawlers in and hands them your sitemap. The pointer stays correct even on sub-path installs. </div> <div class="lp-card" markdown="1">

RSS feed

A feed readers actually subscribe to: escaped titles, per-page pubDate, honest per-page dates. </div> <div class="lp-card" markdown="1">

A noindex 404

Dead ends resolve to a 404 that search engines skip. Generated when your tree lacks one; a 404 you ship is finished, not overwritten. </div> <div class="lp-card" markdown="1">

Cache-busted assets

Every asset URL carries the content-derived build hash, so a CDN that keys on URL or content refetches when your assets change - with optional purge hooks for edge caches that ignore both. </div> <div class="lp-card" markdown="1">

Sub-path friendly URLs

Canonical, sitemap, feed and 404 links carry site.url + basePath exactly once, so sub-path installs just work. </div> <div class="lp-card" markdown="1">

Every internal link is checked on every run - and with --strict a broken one fails the build. freestruct audit verifies the same truth independently on the baked output. </div> <div class="lp-card" markdown="1">

Scoped config

jsonLd and og.scoped take slug globs (/faq exact, /blog/* one segment, /guides/** a sub-tree), so page-specific schema and per-directory image variants stay config-side. </div> <div class="lp-card" markdown="1">

Per-page OG images

ogImageGeneration renders a branded 1200x630 PNG per page from your SVG template, wired under missing-only. </div> <div class="lp-card" markdown="1">

Discovery extras

Opt-in keys that finish the modern head: search, breadcrumb, article.scoped, verification, locales and llms. All missing-only, all pinned. </div> <div class="lp-card" markdown="1">

Loud diagnostics

A named cause and an exit code that says which step failed (1 config, 2 template, 3 output dir, 4 hook failure), never a mystery crash. --tolerant keeps experiments soft. </div> </div> </div>

It generates HTML too

Artifacts, not just tags

Freestruct also writes complete HTML and machine-readable output you can serve as-is.

A noindex 404.html

Generated when your built tree lacks one. Your own 404 is respected and finished - never overwritten. </div> <div class="lp-card" markdown="1">

Real artifacts

sitemap.xml, robots.txt and feed.xml written as files your host serves directly. </div> <div class="lp-card" markdown="1">

Packaged templates

The meta/canonical block, Open Graph, Twitter and JSON-LD segments - ready as-is or as a starting point. Stage a copy in docs/_freestruct/ and it always wins. </div> <div class="lp-card" markdown="1">

The init/ scaffold kit

A commented starter config plus template copies, version-stamped to your install. Copy and go:

npm install --save-dev freestruct
cp -r node_modules/freestruct/init/docs .
Quick start

Four steps to a finished tree

1. Build like always

Your SSG stays untouched; whatever it emits is the input.

jekyll build   # or hugo, mkdocs build, ...

2. Add one config

Site name plus URL; options are optional. Unknown or retired keys warn loudly.

site:
  name: My Docs
  url: https://example.com/docs

3. Run Freestruct

Config and output dir are discovered automatically.

npx freestruct

4. Verify

The independent audit checks the baked output and names every gap.

npx freestruct audit
Why a layer

With Freestruct vs doing it by hand

With FreestructDoing it by hand
Write 4 lines of config onceEdit every page template
Run one command after buildMaintain a plugin per SSG forever
Switch SSGs without changing the SEO planRe-implement meta + sitemap each time
Trust a CI that attacks its own outputHope nothing regresses
For agents too

Agent-hardened and CI-proven

The boring trust facts are pinned by a 192-test battery and run on every push.

Named exit codes

exit 0 quietly means the tree finished; 1 / 2 / 3 / 4 name exactly which step failed (config, template, output dir, hook failure). </div> <div class="lp-card" markdown="1">

Proven fresh install

The tarball e2e proves real pack, real install, real quick start on every run. </div> <div class="lp-card" markdown="1">

Attacked on purpose

An adversarial crashtest pack attacks our own built docs in CI on every push. </div> <div class="lp-card" markdown="1">

Docs that hold up

Broken-links-as-failures is how our own Pages deploy runs, and AGENTS.md orients a coding agent in one file. </div> </div> </div>

Ship docs search engines can actually see

Install, add two config lines, run one command. Your built tree comes out with the SEO every page was missing.