Build process
The build turns every document into a static site. It runs once, when you publish, and is then cached until the next build. Anything that has to be current on every visit, is fetched in the browser (see Integrations).
-
Validate. Every object with a
_typeis checked against its schema. Problems are reported, and an invalid value falls back to its field's default, so one bad field doesn't drop a page. -
Render. Each document is matched to a component by
_typeand filled in with its fields, producing plain HTML. -
Write. Every rendered page is saved as its own
.htmlfile, at a path derived from the document's file path. Anindexfile takes the URL of its folder:File URL Output /documents/index.json//index.html/documents/about.json/about/about/index.html/documents/blog/index.yml/blog/blog/index.html/documents/blog/hello.md/blog/hello/blog/hello/index.html -
Bundle. Repeated
<style>/<script>blocks are deduplicated into shared files. -
Sitemap. Once the project has its own domain, a
sitemap.xmllisting every page and arobots.txtare generated. -
Merge assets. Files in
/assets/are copied into the output as they are, without the/assetsprefix. An asset always takes precedence over a generated file with the same path:File URL Output /assets/main.css/main.css/main.css/assets/images/logo.png/images/logo.png/images/logo.png/assets/integrations/cart.js/integrations/cart.js/integrations/cart.js/assets/robots.txt/robots.txt/robots.txt(replaces the generated one) -
Optimize. Every CSS and JavaScript file is minified (except
.min.files). Every PNG, JPEG and WebP shown with<img>is encoded as WebP at a few widths under/_images/, and the<img>gets asrcsetso each browser downloads only the size it needs. The first image on a page loads with high priority, the others lazily. The original file stays in place, and an<img>with its ownsrcsetor inside a<picture>is left as you wrote it.