Canvas sites
Canvas serves static sites, declared inside one canvas block. Each site is a site block labelled with the path it is served at, and it names the folder to serve. site "/" mounts a folder at the root; any other path mounts a sub-path, which is handy for a public site plus an admin or reviewer area.
- Type
- label
- Default
- REQUIRED
- Meaning
- The path the site is served at:
"/"for the root,"/reviewer"for a sub-path.
- Type
- string
- Default
- REQUIRED
- Meaning
- The folder it serves, relative to the Driftfile. A folder that does not exist is refused at this line.
canvas {
site "/" {
dir = "canvas/public"
}
site "/reviewer" {
dir = "canvas/reviewer"
}
}A file has at most one canvas block, and it may declare several sites, one block each. A site block with no dir is refused, naming the site.
How much storage the slice has for all its sites together is canvas_storage in the limits block of slice, a size such as "200MiB". It is the storage across every site the slice serves, and the free slice grants 50MiB of it.
slice "gemeente" {
limits {
canvas_storage = "200MiB"
}
}
canvas {
site "/" {
dir = "site"
}
site "/reviewer" {
dir = "admin"
}
}A site the file does not name is left serving. drift plan shows it as - site /old still served: no drift command removes a site yet, and nothing prunes it: no drift command removes a site today, and the plan says exactly that rather than offering a command that does not exist. A site the file does name is uploaded again on every apply, since the slice keeps no hash of a site's files to compare.
A password gate in front of the sites is declared under edge.site_auth.