fix(sitemap): derive locales from i18n config, add x-default and per-locale URLs - #754
Draft
dgaponov wants to merge 1 commit into
Draft
fix(sitemap): derive locales from i18n config, add x-default and per-locale URLs#754dgaponov wants to merge 1 commit into
dgaponov wants to merge 1 commit into
Conversation
…locale URLs The sitemap kept its own hardcoded locale list that had drifted from next-i18next.config.js. Three problems followed: - `pt` and `ja` were never submitted, although both are fully translated and already advertised in every page's <head> hreflang set. - No x-default alternate was emitted. - Only the English URL was ever used as <loc>, so the eight localized trees were never submitted as first-class URLs, only as alternate annotations hanging off the English entry. Derive the list from the i18n config so it cannot drift again, emit one <url> per (path x locale) with a self-referencing reciprocal alternate set, and add x-default pointing at the English version. pt and ja were verified to be genuine, complete locales before including them: both ship all 19 dictionary files at sizes comparable to de and ru, and their pages render real Portuguese and Japanese. The English meta description they serve is a site-wide issue affecting ru and de equally, not evidence that these routes are unintended. Sitemap goes from 160 to 1440 URLs (1.6 MB), well under Google's 50k/50 MB limits. Verified in dev and a production build: 10 distinct hreflang values, x-default on every entry, 160 <loc> per locale, and a 111-URL spread sample across locales all returning 200. Build, lint and typecheck pass. E2E not run - Playwright browsers are not installed locally. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
В sitemap был свой захардкоженный список локалей, разошедшийся с
next-i18next.config.js:ptиjaне попадали в выдачу вообще, не былоx-default, а в<loc>всегда шёл английский URL — восемь локализованных деревьев не отправлялись как самостоятельные страницы.Теперь список берётся из i18n-конфига, генерируется по одному
<url>на пару (path × locale) со взаимными альтернатами иx-default.pt/jaперед включением проверены: полные словари (19 файлов, объём как уde/ru), страницы на реальных португальском и японском.160 → 1440 URL (1.6 МБ), с запасом под лимитами Google. Выборка из 111 URL по всем локалям — все 200.
🤖 Generated with Claude Code