Skip to content

Commit

Permalink
docs: update prerender options
Browse files Browse the repository at this point in the history
  • Loading branch information
Atinux committed Sep 8, 2023
1 parent 9bb5526 commit 11a2412
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion docs/content/3.config.md
Original file line number Diff line number Diff line change
Expand Up @@ -337,14 +337,41 @@ routeRules: {

### `prerender`

Default: `{ crawlLinks: false, ignore: [], routes: [] }`
Default:

```ts
{
autoSubfolderIndex: true,
concurrency: 1,
interval: 0,
failOnError: false,
crawlLinks: false,
ignore: [],
routes: []
}
```

Prerendered options. Any route specified will be fetched during the build and copied to the `.output/public` directory as a static asset.

Any route that starts with a prefix listed in `ignore` will be ignored.

If `crawlLinks` option is set to `true`, nitro starts with `/` by default (or all routes in `routes` array) and for HTML pages extracts `<a>` tags and prerender them as well.

You can set `failOnError` option to `true` to stop the CI when an error if Nitro could not prerender a route.

The `interval` and `concurrency` options lets you control the speed of pre-rendering, can be useful to avoid hitting some rate-limit if you call external APIs.

Set `autoSubfolderIndex` lets you control how to generate the files in the `.output/public` directory:

```bash
# autoSubFolderIndex: true (default)
/about -> .output/public/about/index.html
# autoSubFolderIndex: false
/about -> .output/public/about.html
```

This option is useful when your hosting provider does not give you an option regarding the trailing slash.

## Directories

### `rootDir`
Expand Down

0 comments on commit 11a2412

Please sign in to comment.