Skip to content

fix: pin per-page canonical URLs to the /docs subpath#20

Merged
a-essawy merged 1 commit into
mainfrom
fix/per-page-canonical
Jun 11, 2026
Merged

fix: pin per-page canonical URLs to the /docs subpath#20
a-essawy merged 1 commit into
mainfrom
fix/per-page-canonical

Conversation

@a-essawy

Copy link
Copy Markdown
Contributor

Problem

Every page served on the rendobar.mintlify.app subdomain emits a canonical that drops the /docs subpath:

<link rel="canonical" href="https://rendobar.com/quickstart"/>  <!-- 404 -->

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.canonical base, so the base's /docs path 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

  • Pin 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.
  • Enforce the exact canonical value per page in 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 pass
  • Post-deploy: curl -s https://rendobar.mintlify.app/quickstart | grep canonical must show https://rendobar.com/docs/quickstart

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.
@mintlify

mintlify Bot commented Jun 11, 2026

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
Rendobar 🟢 Ready View Preview Jun 11, 2026, 6:12 AM

💡 Tip: Enable Workflows to automatically generate PRs for you.

@a-essawy a-essawy merged commit 0a9a552 into main Jun 11, 2026
4 checks passed
@a-essawy a-essawy deleted the fix/per-page-canonical branch June 11, 2026 06:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant