fix(seo): emit clean docs URLs and de-index the demo (#598)

The docs sitemap listed .html URLs that Cloudflare Pages 308-redirects to
their clean form, while every page's canonical/hreflang already pointed at
the clean URL. Google indexed the redirecting .html variant and picked its
own canonical (GSC "Duplicate, Google chose different canonical"), and burned
crawl budget re-fetching redirecting URLs. Setting VitePress cleanUrls:true
makes the sitemap and internal links extension-less so they match the
canonicals. CF Pages already serves the clean URL at 200 and 308s the .html
form, so no hosting change is needed and legacy .html hits consolidate.

Also mark demo.snapotter.com noindex: it mirrors the real app under the same
domain property, so its routes were being crawled and indexed as thin,
duplicate pages.
This commit is contained in:
SnapOtter
2026-07-21 15:22:15 +08:00
committed by GitHub
parent 577d74bdb1
commit e6718ada71
2 changed files with 11 additions and 1 deletions
+3 -1
View File
@@ -14,7 +14,9 @@
<meta property="og:type" content="website" />
<meta property="og:url" content="https://demo.snapotter.com" />
<meta property="og:image" content="https://snapotter.com/og-image.png" />
<meta name="robots" content="index, follow" />
<!-- Demo mirrors the real app and lives under the same domain property; keep it
out of search to avoid thin/duplicate pages (GSC "Crawled - currently not indexed"). -->
<meta name="robots" content="noindex, nofollow" />
</head>
<body>
<div id="root"></div>
+8
View File
@@ -117,6 +117,14 @@ export default defineConfig({
outDir: "./.vitepress/dist",
ignoreDeadLinks: [/localhost/],
// Extension-less URLs in both internal links and the sitemap, so they match
// the clean canonical/hreflang emitted in transformHead below. Without this
// the sitemap listed .html URLs that Cloudflare Pages 308-redirects to the
// clean form, so Google indexed the redirecting variant and overrode our
// canonical (GSC "Duplicate, Google chose different canonical"). CF Pages
// serves the clean URL at 200, so no extra server config is needed.
cleanUrls: true,
sitemap: { hostname: "https://docs.snapotter.com" },
head: [