Deployment
After running composer build, the dist/ directory contains a fully static site ready for deployment.
Supported platforms
The output works with any static hosting provider:
- Netlify -- connect your repo, set build command to
composer build, publish directory todist/ - Vercel -- same approach, or deploy the
dist/folder directly - GitHub Pages -- push the
dist/folder or use a GitHub Action - Cloudflare Pages -- connect your repo with
dist/as output directory - DigitalOcean App Platform -- point to the
dist/directory - Any web server -- upload
dist/to your server's document root
Committing dist/
You can choose to either:
- Commit
dist/to git -- the simplest approach. Your hosting platform serves the files directly without running a build step. - Build on deploy -- add
composer buildas a build command in your hosting platform's settings. Requires PHP on the build server.
Production URL
Set production_url in config.yml to enable sitemap and robots.txt generation:
leaf:
production_url: "https://docs.example.com"
This generates:
dist/sitemap.xmlwith all page URLs and hreflang alternatesdist/robots.txtwith a reference to the sitemap
Custom domain
After deploying, configure your DNS to point to your hosting provider. Most providers support custom domains with automatic HTTPS via Let's Encrypt.
404 handling
The build produces a dist/404.html file. Most static hosting providers serve this automatically for unmatched routes. If yours doesn't, configure it in your provider's settings.