Skip to content

feat(i18n): add central route map and SEO links with contextual LanguageSwitch - #6

Merged
Don-Damiano merged 2 commits into
mainfrom
work/implement-i18n-routing-and-seo-features
Jan 29, 2026
Merged

feat(i18n): add central route map and SEO links with contextual LanguageSwitch#6
Don-Damiano merged 2 commits into
mainfrom
work/implement-i18n-routing-and-seo-features

Conversation

@Don-Damiano

Copy link
Copy Markdown
Member

Motivation

  • Provide a single source of truth for PL/EN routing so pages, switches and SEO links are always consistent.
  • Ensure correct production-ready hreflang and canonical tags and a contextual language switch that maps the current page between languages.

Description

  • Add src/i18n/routes.ts exporting getRoutePaths, RouteKey and a dynamic builder for case study routes.
  • Update src/layouts/BaseLayout.astro to accept routeKey and optional routeParams, and to generate canonical and hreflang tags using the route map and base https://rocketdeploy.dev.
  • Update src/components/LanguageSwitch.astro and src/components/Header.astro to accept and forward routeKey/routeParams and to produce contextual PL/EN links via getRoutePaths.
  • Modify page files under src/pages/pl and src/pages/en to pass appropriate routeKey (and routeParams for dynamic caseStudy pages) to BaseLayout so routing and SEO metadata are computed centrally.

Testing

  • No automated tests were run for this change.

Codex Task

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d0fc2c0567

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/layouts/BaseLayout.astro Outdated
Comment on lines +25 to +26
const baseUrl = "https://rocketdeploy.dev";
const { pl: plPath, en: enPath } = getRoutePaths(routeKey, routeParams);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Guard BaseLayout against missing routeKey

BaseLayout now unconditionally calls getRoutePaths(routeKey, routeParams), but routeKey is only required by convention; there are still callers like src/layouts/CaseStudyLayout.astro that render <BaseLayout ...> without a routeKey, which will make routes[routeKey] undefined and throw during build/render for any page that uses that layout. Either update those callers to pass routeKey/routeParams or add a defensive fallback here to avoid a runtime crash when a layout is missing the new prop.

Useful? React with 👍 / 👎.

@Don-Damiano

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. What shall we delve into next?

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@Don-Damiano
Don-Damiano merged commit 53cd81c into main Jan 29, 2026
@Don-Damiano
Don-Damiano deleted the work/implement-i18n-routing-and-seo-features branch January 29, 2026 11:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant