Expand description
statica — discover → pre → parse → layout → funnel → expand → bind → scope → emit
§Pipeline
- Discover — every
**/index.htmlunder the site root ([param]→ collection). - Pre — authoring HTML normalization before html5ever (e.g.
<slot>in<select>). - Parse — html5ever → owned AST; post-parse authoring lower (carriers → slots).
- Layout — project page head/body content into
rel="statica/layout"shells. - Funnel — load
<link rel="statica/data">sources (JSON, JSONL/NDJSON, CSV, text, Markdown). - Expand — static (1:1), collection (1:N items), or pagination (1:N page chunks).
- Bind — slots +
${…}attrs +data-t/data-t-{attr}i18n + fragment/data-eachexpansion + form wiring. - Scope — hash-scoped CSS/JS for fragments (CSS via lightningcss +
[data-s]). - Emit — write HTML; transform CSS to browser-ready; optional asset process + responsive images; sitemap / RSS / web manifest.
- Minify — optional final pass on HTML, CSS, and JS in
out_dir.
The statica CLI owns end-user config (statica.toml) and maps it into
BuildOptions. This crate does not read config files.
§See also
docs/guide.md— authoring + config reference- [
paginate] — UI list pagination page objects - [
feeds] — sitemap + RSS (viasitemap-rs/rss) - [
manifest] — web app manifest scaffold + automatic PWA head tags
Re-exports§
pub use css::transform_and_scope;pub use css::transform_css;pub use parse::Document;
Modules§
- css
- Builtin CSS transform via lightningcss.
- parse
- Owned HTML AST + html5ever bridge.
Structs§
- Alias
Options - Alias map from project config (
[aliases]in statica.toml). - Asset
Process Options - Which asset kinds to optimize when processing is on.
- Build
Log - When enabled, emits plain step lines to stderr during
crate::build::build. - Build
Options - Inputs for a build. The CLI maps
statica.tomlinto this; core does not read config files. - Build
Phase - One timed pipeline step (for
--verbosesummary). - Build
Report - Build
Route Row - Pages emitted for one discovered source route.
- Diagnostic
- Authoring diagnostic:
file:line:column: message+ optional rustc-style snippet. - Forms
Options - Build-time form wiring (mapped from
[forms]in statica.toml). - I18n
Catalogs - Loaded translation catalogs keyed by locale code.
- I18n
Options - i18n settings mapped from
[i18n]instatica.toml. - Image
Manifest - Lookup table from normalized image
src→ responsive metadata. - Image
Process Options - Responsive image settings (mapped from
[process.image]in statica.toml). - Local
Alias - Local alias base.
- Manifest
Meta - Values read from the manifest JSON for automatic head-tag injection.
- Minify
Options - Which output kinds to minify when processing is enabled.
- Minify
Report - Pagination
Rule - One paginated listing: chunk a data array into
[page]folder routes. - Resolved
Alias - An alias reference before joining base + tail.
- Responsive
Image - Metadata for a processed source image (keyed by original
srcURL path). - RssOptions
- Search
Options - Sitemap
Options - UrlAlias
- URL alias base.
Enums§
- Alias
Target - Typed alias target.
- Build
Route Kind - Pages emitted for one discovered source route.
- Error
- Library errors for discover / funnel / bind / emit.
The CLI maps these into [
anyhow::Error] at the boundary. - Form
Provider - Form provider backend (from
[forms]in statica.toml). - Minify
Kind - Page
Kind - Render
Mode
Constants§
- A11Y_
TRANSLATABLE_ ATTRS - Accessibility-related attributes that authors typically translate via
data-t-{attr}. - DATA_
T_ ATTR_ PREFIX - MANIFEST_
FILE - Project-relative path to the editable manifest file.
- MANIFEST_
HREF - URL path emitted in HTML (manifest lives at site root after copy from
public/). - STATICA_
JS - Source of
statica.js— the scoped fragment script runtime.
Functions§
- build
- join_
alias - Join alias base and tail into a final URL or local path.
- rebuild_
paths - resolve_
local_ href - Resolve a local href/src after alias expansion.
- resolve_
path - Resolve a single path/URL value. Non-alias values pass through unchanged.
- resolve_
paths_ in_ document - Resolve alias paths in every [
PATH_ATTRS] on all elements.