Examples overview
Pick the row that matches your framework and mode, then copy it:
pnpm dlx degit antstanley/blogwright/examples/<example> my-site| Example | Framework | Mode | Blogwright config |
|---|---|---|---|
| Astro static | Astro | Static site | defaults |
| Astro SSR | Astro + @astrojs/node |
Server-rendered | ssr |
| SvelteKit SSG | SvelteKit + adapter-static |
Static site, prerendered | paths.dist |
| SvelteKit SPA | SvelteKit + adapter-static |
Single-page app | paths.dist, spa |
| SvelteKit SSR | SvelteKit + adapter-node |
Server-rendered | ssr |
| Nuxt SSR | Nuxt 4 (Nitro node-server) |
Server-rendered | ssr |
| TanStack Start SSR | TanStack Start + Nitro | Server-rendered | ssr |
| Next.js SSR | Next.js standalone | Server-rendered | ssr |
Each one is a complete project in the repository’s examples/ folder. Every example was deployed to AWS and checked over its CloudFront URL before it was published.
Static sites and SPAs publish their build output to S3 behind CloudFront. Server-rendered examples run as a Lambda Web Function behind the same distribution, with fingerprinted browser assets still on S3 wherever the framework writes them separately.
Use one
Section titled “Use one”-
Copy it and start a repository:
Terminal window pnpm dlx degit antstanley/blogwright/examples/sveltekit-ssr my-sitecd my-site && git init -
Set
siteNameandregioninconfig/production.jsonc. -
Add Blogwright and commit everything, including
pnpm-lock.yaml:Terminal window pnpm add -D blogwrightgit add -A && git commit -m "Start from the blogwright example" -
Create the infrastructure:
pnpm exec blogwright bootstrap -
Build and publish:
pnpm exec blogwright deploy
Each example’s page lists the files that matter and why.
Inside a larger repository
Section titled “Inside a larger repository”The configs assume the example directory is the repository root, because Blogwright resolves paths and ssr paths from the root. To deploy one from a subdirectory instead:
- Set
paths.appto its directory. - Prefix
paths.dist,ssr.packageDirandssr.staticDirwith that directory.
See Monorepos.
What every example shares
Section titled “What every example shares”| Convention | Why |
|---|---|
Its own pnpm-workspace.yaml and pnpm-lock.yaml |
pnpm treats the directory as a project root, even inside the Blogwright repository. The builder runs pnpm install --frozen-lockfile --prod=false, so the lockfile must be committed. |
pnpm pinned with packageManager |
The builder enables pnpm through corepack, which installs the version packageManager names. |
Install scripts approved in allowBuilds |
pnpm 11 fails an install that meets a dependency build script nobody approved. |
An entry shim (lambda.mjs) in each SSR example |
Lambda passes the listen address in AWS_LAMBDA_HTTP_ENDPOINT. The shim maps it onto the variables the framework’s server reads, and pnpm build copies it into the package. |
| Self-contained SSR packages | Lambda loads nothing outside the package, and the build agent rejects symbolic links. Each SSR example either bundles its dependencies or has its framework copy them in as real files. |
Check an SSR package before deploying
Section titled “Check an SSR package before deploying”Run it the way Lambda does - build, copy the package outside the project, and start the entry with AWS_LAMBDA_HTTP_ENDPOINT set:
pnpm buildcp -R .output/server /tmp/pkg && cd /tmp/pkg # the example's ssr.packageDirAWS_LAMBDA_HTTP_ENDPOINT=127.0.0.1:8080 node lambda.mjscurl -i http://127.0.0.1:8080/If curl returns the page, the package starts the way Lambda starts it. Each SSR example’s page has its exact paths.
Related pages
Section titled “Related pages”- Server-rendered sites - the
ssrblock and a recipe per framework - Single-page apps -
spamode - Monorepos -
pathsandsourceInclude - Deploying - what happens during
blogwright deploy