Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: update reference docs #7845

Merged
merged 2 commits into from
Apr 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 63 additions & 0 deletions src/content/docs/en/reference/configuration-reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -1107,6 +1107,18 @@ When `true`, all URLs will display a language prefix.
URLs will be of the form `example.com/[locale]/content/` for every route, including the default language.
Localized folders are used for every language, including the default.

```js
export default defineConfig({
i18n: {
defaultLocale: "en",
locales: ["en", "fr", "pt-br", "es"],
routing: {
prefixDefaultLocale: true,
}
}
})
```

#### i18n.routing.redirectToDefaultLocale

<p>
Expand Down Expand Up @@ -1134,6 +1146,30 @@ export default defineConfig({
})
```

#### i18n.routing.manual

<p>

**Type:** `string`<br />
<Since v="4.6.0" />
</p>

When this option is enabled, Astro will **disable** its i18n middleware so that you can implement your own custom logic. No other `routing` options (e.g. `prefixDefaultLocale`) may be configured with `routing: "manual"`.

You will be responsible for writing your own routing logic, or executing Astro's i18n middleware manually alongside your own.

```js
export default defineConfig({
i18n: {
defaultLocale: "en",
locales: ["en", "fr", "pt-br", "es"],
routing: {
prefixDefaultLocale: true,
}
}
})
```

## Legacy Flags

To help some users migrate between versions of Astro, we occasionally introduce `legacy` flags.
Expand Down Expand Up @@ -1344,3 +1380,30 @@ Both page routes built and URLs returned by the `astro:i18n` helper functions [`

See the [Internationalization Guide](/en/guides/internationalization/#domains-experimental) for more details, including the limitations of this experimental feature.

### experimental.security

<p>

**Type:** `boolean`<br />
**Default:** `false`<br />
<Since v="4.6.0" />
</p>

Enables CSRF protection for Astro websites.

The CSRF protection works only for pages rendered on demand (SSR) using `server` or `hybrid` mode. The pages must opt out of prerendering in `hybrid` mode.

```js
// astro.config.mjs
export default defineConfig({
output: "server",
experimental: {
security: {
csrfProtection: {
origin: true
}
}
}
})
```

Loading