Deploy Adapters
Sol SSG automatically generates platform-specific configuration files based on your deploy target. This ensures optimal performance and compatibility with each hosting provider.
Configuration
Set the deploy field in sol.config.json:
{
"deploy": "github-pages"
}
Supported Platforms
| Platform | Value | Generated Files |
|---|---|---|
| Static (default) | static | None |
| Cloudflare Pages | cloudflare | _routes.json |
| GitHub Pages | github-pages or github | .nojekyll, CNAME |
| Vercel | vercel | vercel.json |
| Netlify | netlify | _headers, _redirects |
| Deno Deploy | deno | None (static files served automatically) |
| Node.js | node | None |
Platform Details
Cloudflare Pages
Generates _routes.json to control which routes are handled by Workers vs static assets.
{
"deploy": "cloudflare"
}
Generated file (_routes.json):
{
"version": 1,
"include": ["/api/*"],
"exclude": ["/*"]
}
Dynamic routes (using _param_ directories) are automatically added to the include array for Worker fallback.
GitHub Pages
Generates .nojekyll to disable Jekyll processing (required for _luna/ directory) and optionally CNAME for custom domains.
{
"deploy": "github-pages",
"ogp": {
"siteUrl": "https://docs.example.com"
}
}
Generated files:
.nojekyll- Empty file to disable JekyllCNAME- Custom domain (extracted fromogp.siteUrl)
Vercel
Generates vercel.json with optimized settings for static sites.
{
"deploy": "vercel"
}
Generated file (vercel.json):
{
"trailingSlash": true,
"cleanUrls": true,
"headers": [
{
"source": "/assets/(.*)",
"headers": [
{ "key": "Cache-Control", "value": "public, max-age=31536000, immutable" }
]
}
]
}
Features:
trailingSlash- Matches Sol SSG's URL conventioncleanUrls- Removes.htmlextensionCache headers for assets and
_luna/directorySPA fallback rewrite (when
navigation.spa: true)
Netlify
Generates _headers and _redirects files.
{
"deploy": "netlify"
}
Generated files:
_headers:
/assets/*
Cache-Control: public, max-age=31536000, immutable
/_luna/*
Cache-Control: public, max-age=31536000, immutable
/*
X-Frame-Options: DENY
X-Content-Type-Options: nosniff
Referrer-Policy: strict-origin-when-cross-origin
_redirects:
# SPA fallback (when navigation.spa is true)
/* /404.html 200
# Or standard 404 fallback
/* /404.html 404
Deno Deploy
No configuration files needed for static sites. Deno Deploy serves static files automatically.
{
"deploy": "deno"
}
Simply upload your dist/ directory to Deno Deploy.
SPA Mode Integration
When SPA navigation is enabled, deploy adapters automatically configure fallback routing:
{
"navigation": {
"spa": true
},
"deploy": "vercel"
}
This adds appropriate rewrite rules to serve 404.html with a 200 status for client-side routing.
Custom Domain (GitHub Pages)
To set a custom domain for GitHub Pages, configure ogp.siteUrl:
{
"deploy": "github-pages",
"ogp": {
"siteUrl": "https://docs.example.com"
}
}
This generates a CNAME file with docs.example.com.