Skip to content

Commit

Permalink
ci: update integration docs (#3427)
Browse files Browse the repository at this point in the history
Co-authored-by: delucis <delucis@users.noreply.github.com>
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
  • Loading branch information
3 people authored Jun 6, 2023
1 parent 3c5bdc8 commit 669b6d5
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions src/content/docs/en/guides/integrations-guide/netlify.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,32 @@ export default defineConfig({
});
```

### Static sites

For static sites you usually don't need an adapter. However, if you use `redirects` configuration (experimental) in your Astro config, the Netlify adapter can be used to translate this to the proper `_redirects` format.

```js
import { defineConfig } from 'astro/config';
import netlify from '@astrojs/netlify/static';

export default defineConfig({
adapter: netlify(),

redirects: {
'/blog/old-post': '/blog/new-post'
},
experimental: {
redirects: true
}
});
```

Once you run `astro build` there will be a `dist/_redirects` file. Netlify will use that to properly route pages in production.

:::note
You can still include a `public/_redirects` file for manual redirects. Any redirects you specify in the redirects config are appended to the end of your own.
:::

## Usage

[Read the full deployment guide here.](/en/guides/deploy/netlify/)
Expand Down

0 comments on commit 669b6d5

Please sign in to comment.