fix: pin per-page canonical URLs to the /docs subpath#20
Merged
Conversation
Mintlify's auto-canonical resolves the page path against the canonical base origin, dropping the /docs prefix on the rendobar.mintlify.app subdomain. Every subdomain page pointed its canonical at a 404 (e.g. rendobar.com/quickstart instead of rendobar.com/docs/quickstart), so search engines ignore it and the subdomain competes with the real docs in the index. The docs.json seo.metatags.canonical base alone (#19) did not fix this. Pin an explicit canonical in every page's frontmatter and enforce the exact value in validate-frontmatter.mjs so new pages can't regress. scripts/add-canonical.mjs regenerates them.
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Every page served on the rendobar.mintlify.app subdomain emits a canonical that drops the
/docssubpath:The real page is
https://rendobar.com/docs/quickstart(200). A canonical pointing at a 404 is ignored by Google, so the mintlify.app subdomain competes with rendobar.com/docs in the index instead of consolidating into it. Flagged by an external SEO check (canonical → 404 status, critical).Root cause: Mintlify resolves the page's request path absolutely against the
seo.metatags.canonicalbase, so the base's/docspath component is lost on the subdomain (where pages are served at the root). #19 set the base and did not fix it — verified live.Fix
canonical: "https://rendobar.com/docs/<page-path>"in the frontmatter of all 25 pages (Mintlify-documented per-page override). Verified the custom-domain surface already self-canonicalizes to these exact URLs, so nothing changes there.scripts/validate-frontmatter.mjs(CI) so a new page without it fails the check.scripts/add-canonical.mjs: idempotent generator that inserts/corrects canonicals from file paths.Verification
node scripts/validate-frontmatter.mjs→ 25/25 passcurl -s https://rendobar.mintlify.app/quickstart | grep canonicalmust showhttps://rendobar.com/docs/quickstart