Skip to main content

Module postprocess

Module postprocess 

Source
Expand description

Post-processing plugins that fix staticdatagen output.

These plugins run in the after_compile phase to sanitise XML feeds, sitemaps, manifests, and HTML output produced by the upstream staticdatagen crate.

  • SitemapFixPlugin – Fixes 1, 2, 10: duplicate XML declarations, double-slash URLs, and per-page lastmod dates.
  • NewsSitemapFixPlugin – Fix 3: populates news-sitemap entries from front-matter metadata.
  • RssAggregatePlugin – Fix 4: aggregates per-page RSS items into the root feed.
  • ManifestFixPlugin – Fix 8: word-boundary-safe description truncation.
  • HtmlFixPlugin – Fix 9: repairs broken .class= image syntax and Fix 7: upgrades JSON-LD @context from http to https.
  • AtomFeedPlugin – Generates an Atom 1.0 atom.xml feed from .meta.json sidecars.
  • JsonFeedPlugin – Generates a JSON Feed 1.1 feed.json from .meta.json sidecars (alongside the RSS/Atom feeds).
  • EdgeHeadersPlugin – Emits PQC-aware platform header configs for Cloudflare Workers, Netlify, and Vercel (issue #550).

Modules§

agentic_discovery
Agentic discovery emitters (issue #552).
edge_headers
PQC-aware edge-runtime header emitter (issue #550).

Structs§

AgentRule
A single User-agent: … block for agents.txt. Mirrors the robots.txt grammar but is also reachable from per-page frontmatter (via the agents: key on a .meta.json sidecar).
AgenticDiscoveryPlugin
Coordinator plugin that fans out to the three agentic-discovery emitters. Registered once in register_default_plugins and runs in after_compile.
AgentsConfig
The [agents] section of ssg.toml. Every field is optional; absent values fall back to safe “off” defaults so that omitting the section produces no new files.
AtomFeedPlugin
Generates an Atom 1.0 atom.xml feed from .meta.json sidecars.
EdgeHeadersPlugin
Postprocess plugin that emits per-platform edge header config.
HtmlFixPlugin
Repairs HTML output:
JsonFeedPlugin
Generates a JSON Feed 1.1 feed.json from .meta.json sidecars.
ManifestFixPlugin
Fixes manifest.json description truncation by using full text or word-boundary-safe truncation at 200 characters.
McpConfig
MCP registry settings. Mirrors the JSON shape consumed by clients (Claude Desktop, IDE integrations, …) but expressed in TOML so site authors can edit it alongside the rest of ssg.toml.
McpPromptDecl
Static MCP prompt declaration.
McpResource
One MCP resource entry. Public so integration tests can construct instances directly and so consumers of the library can fan their own resources in via post-emit hooks.
McpToolDecl
Static MCP tool declaration. The emitter passes these through verbatim to the registry JSON — schema validation is the consumer’s problem.
NewsSitemapFixPlugin
Repairs news-sitemap.xml by populating entries from front-matter metadata instead of using placeholder values.
RssAggregatePlugin
Aggregates per-page RSS items into the root rss.xml feed.
SbomPluginDeprecated
A post-processing plugin that generates a CycloneDX v1.5 SBOM (sbom.cdx.json) for the built website.
SitemapFixPlugin
Repairs and canonicalises the generated sitemap.xml.

Functions§

build_manifest
Pure-function manifest builder — split from write_ai_plugin_json so unit tests can assert the JSON shape without touching the filesystem.
build_registry
Pure-function registry builder, callable from tests without I/O.
collect_mcp_resources
Walk .meta.json sidecars under ctx.site_dir (with the same build_dir/.meta fallback used by RSS/Atom/JSON-Feed) and produce one MCP resource per public page.
render_agents_txt
Pure-function renderer kept separate from I/O so unit tests can assert the exact byte layout without touching the filesystem.
write_agents_txt
Render and write the agents.txt file under ctx.site_dir.
write_ai_plugin_json
Render and write .well-known/ai-plugin.json under ctx.site_dir.
write_mcp_registry
Render and write .well-known/mcp.json under ctx.site_dir.