From 05b8350b41f07440125c81d1ecf84259f3e38742 Mon Sep 17 00:00:00 2001 From: Kristian Antrobus Date: Fri, 31 Jan 2025 13:12:55 -0600 Subject: [PATCH] fix(sitemap): ensure all canonical URL --- packages/paste-website/src/pages/sitemap.xml.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/paste-website/src/pages/sitemap.xml.tsx b/packages/paste-website/src/pages/sitemap.xml.tsx index 8b0318ddb6..25a8359918 100644 --- a/packages/paste-website/src/pages/sitemap.xml.tsx +++ b/packages/paste-website/src/pages/sitemap.xml.tsx @@ -12,9 +12,15 @@ export const getServerSideProps: GetServerSideProps = async ({ res }) => { const sitemap = ` ${SITEMAP.map((url) => { + let fullUrl = `${BASE_URL}${url}`; + + if (!fullUrl.endsWith("/")) { + fullUrl += "/"; + } + return ` - ${BASE_URL}${url} + ${fullUrl} daily 0.7