Skip to content

Fix/seo locale canonical url#92

Open
MaryWylde wants to merge 7 commits intodevfrom
fix/seo-locale-canonical-url
Open

Fix/seo locale canonical url#92
MaryWylde wants to merge 7 commits intodevfrom
fix/seo-locale-canonical-url

Conversation

@MaryWylde
Copy link
Copy Markdown
Contributor

No description provided.

MaryWylde and others added 7 commits April 6, 2026 17:09
Tools and Longevity Improvements
feat(vibesuite): add Knowledge Gaps map, expand skills to 61, fix mod…
Two SEO bugs in SeoGenerator emitted URLs without the active locale prefix.
Search engines indexing structured data on RU/HY pages would record the
wrong canonical, leading to either a hard 404 (when slugs differ between
locales — e.g. uxcore Russian transliterations) or silent locale-dilution
(when slugs are the same — e.g. /ru/articles/awareness-test).

Both issues stem from `router.asPath` returning the canonical (un-prefixed)
path under Next.js Pages Router i18n. The existing `originalUrl` already
prepends `localePath` correctly and is the source of truth used by the
`<link rel=canonical>` and `<meta og:url>` tags.

1. JSON-LD `"url"`: schema generator received `pageUrl` built from
   `domain + router.asPath`, dropping the `/ru` or `/hy` prefix. Now
   reuses `originalUrl` so JSON-LD matches canonical.

2. `<meta name="twitter:url">`: built from
   `https://keepsimple.io/${localePath}${alternateLink}` — a literal `/`
   between domain and `localePath` produced double-slash URLs
   (`https://keepsimple.io//ru/...` for RU, `https://keepsimple.io//...`
   for EN). Now also uses `originalUrl` for consistency and to
   eliminate the divergent-builder pattern that produced the original
   bug.

Verified on /ru/articles/awareness-test and
/ru/tools/longevity-protocol/about-project that JSON-LD `url` previously
emitted the unprefixed path; rendered HTML before fix attached in the
linkinator scan at reports/links-2026-04-28.json.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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