From d38a011e706db02650b4e58ce78cd3d387a3938d Mon Sep 17 00:00:00 2001 From: thedriftofwords Date: Mon, 22 May 2023 15:04:58 -0400 Subject: [PATCH 1/2] Adjust sitemap config to trim trailing slashes --- astro.config.ts | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/astro.config.ts b/astro.config.ts index 0dd217962f1..3c914fa446f 100644 --- a/astro.config.ts +++ b/astro.config.ts @@ -8,8 +8,18 @@ import sitemap from "@astrojs/sitemap" // https://astro.build/config export default defineConfig({ site: "https://docs.chain.link", - // trailingSlash: 'never', - integrations: [preact({ compat: true }), sitemap({ changefreq: "daily" }), mdx()], + trailingSlash: "never", + integrations: [ + preact({ compat: true }), + sitemap({ + serialize(item) { + item.url = item.url.replace(/\/+$/, "") + return item + }, + changefreq: "daily", + }), + mdx(), + ], markdown: { drafts: true, rehypePlugins: [ From 2779b71902e3c9d3bc152715b803a65794a6bf8c Mon Sep 17 00:00:00 2001 From: thedriftofwords Date: Tue, 30 May 2023 14:13:37 -0400 Subject: [PATCH 2/2] Remove commented out line --- astro.config.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/astro.config.ts b/astro.config.ts index 3c914fa446f..81a21467802 100644 --- a/astro.config.ts +++ b/astro.config.ts @@ -8,7 +8,6 @@ import sitemap from "@astrojs/sitemap" // https://astro.build/config export default defineConfig({ site: "https://docs.chain.link", - trailingSlash: "never", integrations: [ preact({ compat: true }), sitemap({