sitemap: Remove trailing slashes from URLs
This commit is contained in:
parent
12ab12af72
commit
45a80e513d
|
@ -1,4 +1,4 @@
|
||||||
import { defineConfig } from 'astro/config';
|
import { defineConfig } from "astro/config";
|
||||||
import alpinejs from "@astrojs/alpinejs";
|
import alpinejs from "@astrojs/alpinejs";
|
||||||
import tailwind from "@astrojs/tailwind";
|
import tailwind from "@astrojs/tailwind";
|
||||||
import mdx from "@astrojs/mdx";
|
import mdx from "@astrojs/mdx";
|
||||||
|
@ -8,10 +8,23 @@ import sitemap from "@astrojs/sitemap";
|
||||||
|
|
||||||
// https://astro.build/config
|
// https://astro.build/config
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
integrations: [alpinejs(), tailwind({
|
integrations: [
|
||||||
config: {
|
alpinejs(),
|
||||||
applyBaseStyles: false
|
mdx(),
|
||||||
}
|
sitemap({
|
||||||
}), mdx(), sitemap()],
|
serialize(item) {
|
||||||
site: 'https://www.oliverdavies.uk'
|
// To prevent crawling errors, remove the trailing slash from the URL
|
||||||
|
// 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,
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
site: "https://www.oliverdavies.uk",
|
||||||
});
|
});
|
Loading…
Reference in a new issue