Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions apps/docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,21 @@ export default defineConfig({
cleanUrls: true,
lastUpdated: true,
srcExclude: ["**/README.md"],
// Emit a sitemap so Google indexes the canonical (clean) URLs directly instead of
// discovering URL variants and consolidating them. Submit it in Search Console.
sitemap: {
hostname: "https://docs.openpicker.dev",
},
// Self-referential canonical per page. With cleanUrls, duplicate variants Google may
// crawl (…/page.html → 307 → /page, the production *.workers.dev origin, etc.) all
// point back to the clean URL, so they consolidate here rather than competing.
transformPageData(pageData) {
const canonical = `https://docs.openpicker.dev/${pageData.relativePath}`
.replace(/index\.md$/, "")
.replace(/\.md$/, "")
pageData.frontmatter.head ??= []
pageData.frontmatter.head.push(["link", { rel: "canonical", href: canonical }])
},
head: [
["link", { rel: "icon", href: "/openpicker.svg" }],
["meta", { name: "theme-color", content: "#0f172a" }],
Expand Down
6 changes: 6 additions & 0 deletions apps/site/public/sitemap.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://openpicker.dev/</loc>
</url>
</urlset>
Loading