# Deployment

Source: https://nera.js.org/docs/deployment.html

Nera outputs a plain `public/` folder — deploy it anywhere that serves static
files.

## Build

```bash
npm run build
```

## Host it

- **Netlify / Vercel** — build command `npm run build`, publish directory
  `public`.
- **GitHub Pages** — build in GitHub Actions and deploy `public/` with
  `actions/upload-pages-artifact` and `actions/deploy-pages`, as this site does.
- **Any static host / CDN** — upload the contents of `public/`.

## Cache busting

Browsers cache stylesheets, scripts and fonts, so after a deploy visitors may
keep seeing the old CSS or JS until they force a reload. Turn on content hashing
in `config/app.yaml` (requires `@nera-static/core` 4.11 or newer):

```yaml
asset_hashing: true
```

On every build Nera appends `?v=<hash>` to each local asset URL — stylesheets,
scripts, images, `srcset`, the search index and `url(…)` references inside CSS
such as fonts. The hash comes from the file's content, so a URL changes exactly
when its file does and stays cacheable otherwise. Your templates keep plain
paths like `/css/main.css`; never add `?v=` by hand.

Page links, external URLs and URLs that already have a query string are left
alone, and it works together with `base_path`. Without the key the build output
is unchanged.

## Before you launch

- Set `origin` in `config/app.yaml` to your real domain so canonical URLs are
  correct (see [Canonical links for SEO](https://nera.js.org/tutorials/canonical-links-seo.html)).
- Add an `.neraignore` at the project root to keep source-only assets out of the
  build.

> `public/` is deleted and rebuilt on every render — never edit it by hand, and
> never commit it as source.
