Static Sites

Build a static-site artifact from Markdown, scripts, styles and images.

A StaticSite artifact renders Markdown, processes scripts and stylesheets, compresses images and copies everything else.

amends "elide:project.pkl"
import "elide:Web.pkl" as Web

artifacts {
  ["site"] = new Web.StaticSite {
    srcs = "site"
    domain = "example.com"
    stylesheets { "site/theme.css" }
    hosting = "github-pages"
  }
}
elide build

Fields

PropertyMeaningDefault
srcsSource directory, relative to the project.—
domainProduction domain.—
previewPreview domain; informational.—
prefixMount path for links and assets; must end with /."/"
assetsPublic asset path."<prefix>_/assets"
stylesheetsAdded to every page, besides those in its frontmatter.none
scriptsAdded to every page, besides those in its frontmatter.none
rewriteLinksRewrite relative Markdown links against prefix.true
hosting"workers" or "github-pages"; informational, the build does not publish.—
dependsOnArtifacts to build first.none

Minification and browser targets come from the web block (Web Toolchain). Without image codecs, the build warns once and copies images unchanged.