From 669b6d5e254fb873807fb43ed78331e2b32797dd Mon Sep 17 00:00:00 2001 From: "Houston (Bot)" <108291165+astrobot-houston@users.noreply.github.com> Date: Tue, 6 Jun 2023 09:51:51 -0700 Subject: [PATCH] ci: update integration docs (#3427) Co-authored-by: delucis Co-authored-by: Sarah Rainsberger --- .../en/guides/integrations-guide/netlify.mdx | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/content/docs/en/guides/integrations-guide/netlify.mdx b/src/content/docs/en/guides/integrations-guide/netlify.mdx index 6455bf9131ae3..d70e4248bee75 100644 --- a/src/content/docs/en/guides/integrations-guide/netlify.mdx +++ b/src/content/docs/en/guides/integrations-guide/netlify.mdx @@ -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/)