A StaticSite artifact renders Markdown, processes scripts and stylesheets, compresses images and copies everything
else.
pkl
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"
}
}
utf-8 · pkl · Lines: 11
Terminal
bash
elide build
Fields
| Property | Meaning | Default |
|---|---|---|
srcs |
Source directory, relative to the project. | — |
domain |
Production domain. | — |
preview |
Preview domain; informational. | — |
prefix |
Mount path for links and assets; must end with /. |
"/" |
assets |
Public asset path. | "<prefix>_/assets" |
stylesheets |
Added to every page, besides those in its frontmatter. | none |
scripts |
Added to every page, besides those in its frontmatter. | none |
rewriteLinks |
Rewrite relative Markdown links against prefix. |
true |
hosting |
"workers" or "github-pages"; informational, the build does not publish. |
— |
dependsOn |
Artifacts 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.
Samples
Start from a template:
Terminal
bash
elide init --template web-simple # static site
elide init --template web-demo # static site with TypeScript and Markdown