From 11a241244a166b0733b924d16ce5a32e1be89005 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Chopin?= Date: Fri, 8 Sep 2023 09:49:31 +0200 Subject: [PATCH] docs: update prerender options --- docs/content/3.config.md | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/docs/content/3.config.md b/docs/content/3.config.md index a78f3f8267..4ad1f887e3 100644 --- a/docs/content/3.config.md +++ b/docs/content/3.config.md @@ -337,7 +337,19 @@ 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. @@ -345,6 +357,21 @@ 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 `` 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`