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

FieldTypeDefaultDescription
srcsFilePath?noneRoot source directory for the site
domainString?noneProduction domain
previewString?nonePreview domain
prefixString"/"Web prefix where the site is mounted (must end with a slash)
assetsString"\(prefix)_/assets"Public web path for the site's assets
stylesheetsListing<FilePath>{}Stylesheets added to all pages
scriptsListing<FilePath>{}Scripts added to all pages
rewriteLinksBooleantrueRewrite links when rendering Markdown
hostingStaticSiteHost?noneHosting target: workers or github-pages

Web settings

Project-wide web behavior is configured in the top-level web { } block (WebSettings):
SettingTypeDefaultDescription
cssCssSettings{}CSS processing (minification and browser targets)
minifyHtmlBooleantrueMinify rendered HTML
browsersListing<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.