Static Sites
Elide can build a static website from your sources — compiling CSS, rendering Markdown to HTML, and processing scripts and assets — then package the result for hosting. A static site is declared as a Web.StaticSite artifact in your elide.pkl manifest and built with elide build.
Declaring a site
pkl
amends "elide:project.pkl"
import "elide:Web.pkl" as Web
artifacts {
["site"] = new Web.StaticSite {
srcs = "src/site"
domain = "example.com"
stylesheets { "src/site/theme.css" }
hosting = "github-pages"
}
}Web.StaticSite fields
| Field | Type | Default | Description |
|---|---|---|---|
srcs | FilePath? | none | Root source directory for the site |
domain | String? | none | Production domain |
preview | String? | none | Preview domain |
prefix | String | "/" | Web prefix where the site is mounted (must end with a slash) |
assets | String | "\(prefix)_/assets" | Public web path for the site's assets |
stylesheets | Listing<FilePath> | {} | Stylesheets added to all pages |
scripts | Listing<FilePath> | {} | Scripts added to all pages |
rewriteLinks | Boolean | true | Rewrite links when rendering Markdown |
hosting | StaticSiteHost? | none | Hosting target: workers or github-pages |
Web settings
Project-wide web behavior is configured in the top-levelweb { } block (WebSettings):
| Setting | Type | Default | Description |
|---|---|---|---|
css | CssSettings | {} | CSS processing (minification and browser targets) |
minifyHtml | Boolean | true | Minify rendered HTML |
browsers | Listing<String> | {} | Browser support targets for all built output |
Build pipeline
Running elide build builds every declared StaticSite. The site build runs a chain of tasks — CSS compilation, HTML build, Markdown rendering, image processing, and copying the remaining sources — before bundling the site output. See the CSS, Markdown, and Media pages for the status of each stage.