DocsDeploy & operate
Static sites
Export an app as plain files for GitHub Pages, a bucket or any web host, with no Sluurp server behind it.
sluurp static turns an app into plain files you can host anywhere: GitHub Pages, a storage bucket, a CDN or any web server. Pages are drawn in advance, so they arrive complete, and islands still come alive in the browser. To export an app:
sluurp static --public app --out distFeatures include:
- Every page reachable from
/, with the scripts, styles, fonts and images it uses - Islands that still react to clicks and input
- A base path for sites served from a folder, such as GitHub Pages
- No licence needed, since no Sluurp server runs it
The app is served on your machine and read the way a visitor reads it. Every page reachable from / is saved, along with everything the pages use: scripts, stylesheets, islands, fonts and images. A page is written as path/index.html, and any other file under its own path. When the build finishes, the command lists any links it couldn’t fetch.
Options
--publicnames the app folder, as it does forsluurp serve. Add more apps asNAME=DIR, and each one is exported under/NAME/.--outis the folder the files go to. By default, it’sdist.--baseis the folder the site is served from, when it isn’t the root. A project’s GitHub Pages site lives at/<repo>/, so you would pass--base /<repo>/.
sluurp static --public app --out dist --base /my-site/What works, and what stays behind
Everything that only draws works: pages, layouts, Markdown, server components drawn at build time, and islands that react to clicks and input. Anything that needs a running server isn’t included: the REST API, sync, sign-in and "use server" functions. An island that calls the server will find nobody there to answer.
The output is ready for file hosts as it is. Modules compiled from .ts and .tsx are saved as .js files, and the folder includes a .nojekyll file so GitHub Pages keeps Sluurp’s /_/ folder.
Licence
A static site needs no licence, even when it is made for a business or a paying client, because no Sluurp server runs it. This holds only while no Sluurp server serves it: a site served by Sluurp, static or not, is commercial use like any other and needs a business licence. See Business licence.