Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Fix sitemap URLs to include /help prefix

setalpee17323e3808
diff --git a/docs/docs/.vitepress/config.ts b/docs/docs/.vitepress/config.ts
index ef678656cc..a8fe0dff2e 100644
--- a/docs/docs/.vitepress/config.ts
+++ b/docs/docs/.vitepress/config.ts
@@ -12,7 +12,24 @@ export default defineConfig({
cleanUrls: true,
ignoreDeadLinks: "localhostLinks",
sitemap: {
- hostname: "https://ente.io/help",
+ hostname: "https://ente.io/help/",
+ transformItems: (items) => {
+ // Remove trailing slashes for consistency (cleanUrls is enabled)
+ // and deduplicate URLs
+ const seen = new Set();
+ return items
+ .map((item) => ({
+ ...item,
+ url: item.url.replace(/\/$/, ''),
+ }))
+ .filter((item) => {
+ if (seen.has(item.url)) {
+ return false;
+ }
+ seen.add(item.url);
+ return true;
+ });
+ },
},
transformPageData(pageData) {
// Add canonical URL to all pages