Skip to content

docs site: no metadataBase and no canonical link on any page #12234

Description

@os-zhuang

One-liner

Not one page on the site emits <link rel="canonical">, and the root layout sets no metadataBase. Every URL variant of a page — query strings, tracking parameters, the /en/ prefixed form — is a separate document to a search engine, with nothing declaring which one is real.

Measured

$ grep -rn "metadataBase\|canonical\|alternates" apps/docs --include=*.ts --include=*.tsx | grep -v node_modules
(no matches)
$ curl -s http://localhost:3999/docs/data-modeling/objects | grep -c 'rel="canonical"'
0

Without metadataBase, any relative URL handed to openGraph/alternates resolves against a build-time guess rather than the real origin — which is why it must land before, or with, the Open Graph card.

Expected

  • apps/docs/app/layout.tsx: metadataBase: new URL('https://objectstack.ai'), from the same shared origin constant the sitemap uses.
  • apps/docs/app/[lang]/docs/[[...slug]]/page.tsxgenerateMetadata: alternates: { canonical: page.url }.
  • Same for the homepage, the blog index and blog posts.

Acceptance

  • every page type emits exactly one <link rel="canonical">, absolute, on https://objectstack.ai
  • /docs/x?utm_source=y and /docs/x both canonicalise to /docs/x
  • the Next build no longer warns about a missing metadataBase

Source

Found in an SEO review of the docs site (apps/docs) run on 2026-08-25, measured against the local dev server and against production. The canonical origin is https://objectstack.ai — maintainer ruling recorded in #10659:

这个仓的文档站规范 URL 是 https://objectstack.ai

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions