Skip to content

armgit / ente

Public Imported from GitHub
0

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

[docs] Update canonical URLs

Vishnu Mohandas5aa325a29248
diff --git a/docs/docs/.vitepress/config.ts b/docs/docs/.vitepress/config.ts
index f5821ec794..778d08d2ba 100644
--- a/docs/docs/.vitepress/config.ts
+++ b/docs/docs/.vitepress/config.ts
@@ -1,6 +1,8 @@
import { defineConfig } from "vitepress";
import { sidebar } from "./sidebar";
+const docsBaseUrl = "https://ente.com/help";
+
// Pages with noindex in frontmatter, collected during build to exclude from sitemap
const noindexPages = new Set<string>();
@@ -15,7 +17,7 @@ export default defineConfig({
cleanUrls: true,
ignoreDeadLinks: "localhostLinks",
sitemap: {
- hostname: "https://ente.io/help/",
+ hostname: `${docsBaseUrl}/`,
transformItems: (items) => {
// Remove trailing slashes for consistency (cleanUrls is enabled)
// and deduplicate URLs
@@ -59,7 +61,7 @@ export default defineConfig({
}
// Add canonical URL to all pages
- const canonicalUrl = `https://ente.io/help/${pageData.relativePath}`
+ const canonicalUrl = `${docsBaseUrl}/${pageData.relativePath}`
.replace(/index\.md$/, "")
.replace(/\.md$/, "");
pageData.frontmatter.canonicalUrl = canonicalUrl;
@@ -67,13 +69,13 @@ export default defineConfig({
async transformHead({ pageData }) {
const head: any[] = [];
const canonicalUrl =
- pageData.frontmatter.canonicalUrl || `https://ente.io/help/`;
+ pageData.frontmatter.canonicalUrl || `${docsBaseUrl}/`;
const title =
pageData.frontmatter.title || pageData.title || "Ente Help";
const description =
pageData.frontmatter.description ||
"Documentation and help for Ente's products";
- const ogImage = "https://ente.io/help/og-image.png"; // You can customize this per page if needed
+ const ogImage = `${docsBaseUrl}/og-image.png`; // You can customize this per page if needed
// Canonical URL
head.push(["link", { rel: "canonical", href: canonicalUrl }]);
@@ -244,11 +246,11 @@ function generateBreadcrumbSchema(pageData: any) {
"@type": "ListItem",
position: 1,
name: "Home",
- item: "https://ente.io/help/",
+ item: `${docsBaseUrl}/`,
},
];
- let currentPath = "https://ente.io/help";
+ let currentPath = docsBaseUrl;
parts.forEach((part, index) => {
currentPath += `/${part}`;
items.push({