feat: generate redirects in Astro
The only thing I couldn't get working were `articles/*` to `blog/*` redirects, but those haven't been used for a long time and can be re-attempted another time.
This commit is contained in:
parent
25dcd4dd37
commit
de7aa271f2
3 changed files with 1390 additions and 797 deletions
|
@ -1,9 +1,9 @@
|
|||
import { defineConfig } from "astro/config";
|
||||
import alpinejs from "@astrojs/alpinejs";
|
||||
import tailwind from "@astrojs/tailwind";
|
||||
import mdx from "@astrojs/mdx";
|
||||
|
||||
import redirects from "./redirects.json";
|
||||
import sitemap from "@astrojs/sitemap";
|
||||
import tailwind from "@astrojs/tailwind";
|
||||
import { defineConfig } from "astro/config";
|
||||
|
||||
// https://astro.build/config
|
||||
export default defineConfig({
|
||||
|
@ -16,13 +16,14 @@ export default defineConfig({
|
|||
// otherwise it will be a link to a redirect URL and not the content.
|
||||
item.url = item.url.replace(/\/$/, "");
|
||||
return item;
|
||||
}
|
||||
},
|
||||
}),
|
||||
tailwind({
|
||||
config: {
|
||||
applyBaseStyles: false
|
||||
}
|
||||
applyBaseStyles: false,
|
||||
},
|
||||
}),
|
||||
],
|
||||
site: "https://www.oliverdavies.uk"
|
||||
redirects,
|
||||
site: "https://www.oliverdavies.uk",
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue