Skip to content

fix(seo)!: canonical and sitemap point at weekndlabs.com/design - #29

Merged
fajarhide merged 1 commit into
mainfrom
fix/canonical-to-proxy-host
Jul 30, 2026
Merged

fix(seo)!: canonical and sitemap point at weekndlabs.com/design#29
fajarhide merged 1 commit into
mainfrom
fix/canonical-to-proxy-host

Conversation

@fajarhide

Copy link
Copy Markdown
Contributor

Settles the question #28 deliberately left open. The proxy path wins: every
inbound link and every internal link already pointed there, and one domain is
easier to grow than two.

BREAKING for anything reading the canonical. It was design.weekndlabs.com and is
now weekndlabs.com/design.

What changed

Before After
site https://design.weekndlabs.com https://weekndlabs.com/design/
Canonical design.weekndlabs.com/guide/ weekndlabs.com/design/guide/
Sitemap entries 3, on the subdomain 3, on the proxy path
Sitemap generator @astrojs/sitemap src/pages/sitemap.xml.js

The subdomain stays fully crawlable. Disallowing it would stop Google reading the
canonical tag that does the deduplicating, which is the opposite of what blocking
a duplicate achieves. There is a comment in robots.txt saying so, because it
looks like an oversight otherwise.

The trap this ran into

An origin with a path does not survive the obvious join:

new URL('/guide/', 'https://weekndlabs.com/design/').href
// 'https://weekndlabs.com/guide/'   <- /design is gone

A leading slash replaces the entire path. So site ends in a slash and the route
is joined relatively, in both places that build a URL. Each has its own assertion,
because the failure is silent: the build succeeds and every canonical points at a
page that does not exist.

Why @astrojs/sitemap was removed

It was added in #28 and lasted one commit. It joins routes with a leading slash
internally, so with the new site it emitted:

https://weekndlabs.com/guide/                <- wrong, /design dropped
https://weekndlabs.com/sitemap-0.xml         <- wrong, and a 404

Astro's base: '/design' would fix the join and break everything else: this same
build is also served at the subdomain root, where /design/_astro/… is a 404.

Three URLs did not justify configuring around that. src/pages/sitemap.xml.js
emits them directly and reads the routes from the pages directory via
import.meta.glob, so adding a page adds it to the sitemap. One fewer dependency
than before #28.

What this cannot finish, and it matters

robots.txt is read from an origin root and never from a path. Google reads
weekndlabs.com/robots.txt for the canonical host, and that file belongs to the
main site's repo, injected in part by Cloudflare. The Sitemap: directive has to
be added there too, or the sitemap submitted in Search Console.
Until then the
sitemap exists and is correct but is not discoverable from robots.txt.

The directive in docs/public/robots.txt still points at the right URL and only
ever answers at design.weekndlabs.com/robots.txt, which is the non-canonical
host. The comment in the file says all of this.

Verification

  • 51 tests, exit 0. dist/ reproduces
  • built canonicals: weekndlabs.com/design/, /design/guide/, /design/components/
  • built sitemap carries the same three URLs, /design intact on each
  • to confirm after deploy: curl -s https://design.weekndlabs.com/sitemap.xml
    should list the three weekndlabs.com/design/… URLs, and every page's canonical
    should match its own sitemap entry

Still not claimed

No Search Console data has been seen, so no page is known to be failing to index.
This fixes a structural defect found by measurement. It also fixes discovery, not
traffic; those remain separate problems.

The proxy path wins. Every inbound link and every internal link already pointed
there, and one domain is easier to grow than two.

BREAKING for anything reading the canonical: it was design.weekndlabs.com and is
now weekndlabs.com/design. The subdomain stays fully crawlable on purpose, because
blocking a duplicate stops Google reading the canonical tag that deduplicates it.

An origin with a path breaks the obvious join. `new URL('/guide/', '…/design/')`
resolves to weekndlabs.com/guide: a leading slash replaces the whole path. So
`site` ends in a slash and the route is joined relatively, in both places that
build a URL, with a test on each.

@astrojs/sitemap was added for this and is now removed. It joins with a leading
slash internally, so it emitted weekndlabs.com/guide/ and a sitemap index at
weekndlabs.com/sitemap-0.xml, neither of which exists. Astro's `base` would fix
the join and break the subdomain, where /design/_astro/… is a 404. Three URLs did
not justify configuring around that, so src/pages/sitemap.xml.js emits them and
reads the routes from the pages directory, so a new page is never forgotten.

One thing this cannot finish: robots.txt is read from an origin root, never from a
path, so Google reads weekndlabs.com/robots.txt for the canonical host and that
file lives in the main site's repo. The Sitemap directive has to be added there
too, or the sitemap submitted in Search Console. The comment in
docs/public/robots.txt says so.
@vercel

vercel Bot commented Jul 30, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
design Ready Ready Preview Jul 30, 2026 12:57pm

@fajarhide
fajarhide merged commit 40de88a into main Jul 30, 2026
3 checks passed
@fajarhide
fajarhide deleted the fix/canonical-to-proxy-host branch July 30, 2026 13:01
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