Skip to content

feat(site): link to the Console pages in the page's language - #66852

Merged
MrMushrooooom merged 3 commits into
devfrom
site-console-links
Nov 27, 2026
Merged

MrMushrooooom merged 3 commits into
devfrom
site-console-links

Conversation

@MrMushrooooom

@MrMushrooooom MrMushrooooom commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Follows #66844.

Makes the site's Console marketing links carry the page's language from the header, sidebar and footer, the home Console and Get started CTAs, BYOS links, the search index and Markdown. Only the exact marketing pages are prefixed (landing, models, go, enterprise, teams, support, integrations); subpaths such as /console/models/compare, the guides and Console app paths such as /console/workspace stay unprefixed.

Do not merge until anomalyco/opencode-console#9155 and #9183 are deployed. Until then, this site's middleware 301s /<locale>/console/... to the English page. Merging earlier would let browsers cache those permanent redirects, so readers would stay on English after the Console localizes. test/console-links.test.ts asserts that localized("/console") stays false and that the middleware's redirect target remains /console.

Adds the 17 localized Console sitemaps (/<locale>/console/sitemap.xml) to sitemapFiles, next to the existing English /console/sitemap.xml, so crawlers reach them from /sitemap.xml, the one sitemap robots.txt lists. test/sitemap.test.ts checks every localized entry.

Legacy /<locale>/go, /<locale>/zen and /<locale>/enterprise now redirect to the matching /<locale>/console/... page instead of English; English URLs are unchanged. test/legacy.test.ts covers all three.

Checks: bun src/i18n/check.ts (0 errors, 0 changed, 0 unused), bun typecheck, bun test (255 pass, 0 fail), and the full site build including check-worker-start.

@adamdotdevin adamdotdevin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good. The Console's locale list on opencode-console#9183 matches the site's 17, and every link here points at a page it localizes, so these will resolve once it deploys. Hold the merge until opencode-console#9155 and #9183 are live, or browsers cache the 301 back to English. Small stuff:

  • consoleMarketingPath matches subpaths too, so /console/integrations/<slug> would get a prefix even though the Console keeps the guides English. Exact matches would be simpler.
  • Since this lands after those deploys, the comment could just say the Console serves its marketing pages at /<locale>/console/... and keeps the guides and app pages at /console/....
  • The pageLocale and page-markdown.ts reformats are unrelated.
  • Naming the param console shadows the global.

Needs a rebase on #66772 (conflict in language.ts).

@MrMushrooooom
MrMushrooooom changed the base branch from site-zh-terms to shared-locale November 27, 2026 19:44
@MrMushrooooom

Copy link
Copy Markdown
Contributor Author

@adamdotdevin rebased onto #66772 (shared-locale), exact-match links, param/comment/reformat fixes, plus the 17 localized Console sitemaps in robots.txt. head ce7556a

adamdotdevin
adamdotdevin previously approved these changes Nov 27, 2026

@adamdotdevin adamdotdevin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

All four nits are in: exact matches, the comment, the formatting and consoleHref. The robots.txt sitemap lines come with a test. Rebased cleanly on #66772. LGTM, merge after opencode-console#9155 and #9183 are live.

@MrMushrooooom
MrMushrooooom requested a review from thdxr as a code owner November 27, 2026 20:12
@MrMushrooooom
MrMushrooooom changed the base branch from shared-locale to dev November 27, 2026 20:12
@MrMushrooooom
MrMushrooooom dismissed adamdotdevin’s stale review November 27, 2026 20:12

The base branch was changed.

@MrMushrooooom

Copy link
Copy Markdown
Contributor Author

rebased on dev after #66787 merged, head b85d759. still waiting on opencode-console#9155 and #9183

@opencodejr opencodejr Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The localized Console links work as described. consoleRoute prefixes only the exact marketing pages, every header, sidebar, footer, CTA, BYOS, search and Markdown link goes through it, and English and the Console's app paths stay unprefixed. I checked with the site's test suite (256 pass, 0 fail), typecheck:tsc (clean; bun run typecheck fails with Script not found "check" on Bun 1.4.2) and by generating robots.txt and reading its output.

Public API: unchanged. The robots.txt content changes, but no SDK, server, config or CLI surface is touched.

Concerns:

  • The localized Console sitemaps go into robots.txt, but services/site/AGENTS.md says /sitemap.xml is the only sitemap listed there, and the other sitemaps belong in sitemapFiles (src/lib/sitemap.ts). See the inline comment.
  • Non-blocking: localizedMoves in src/lib/legacy.ts still sends /<locale>/go, /<locale>/zen and /<locale>/enterprise to the English Console pages with a 301. Once the Console is localized, those old localized URLs could point to /<locale>/console/... instead, using the same deploy timing you describe for this change.

Comment thread services/site/src/lib/robots-txt.ts Outdated
const rules = ["User-agent: *", "Allow: /", "Disallow: /s/", "Disallow: /share/"]
const sitemap = "Sitemap: https://opencode.ai/sitemap.xml"
// The Console serves a sitemap per locale; English is already in the site's sitemap index.
const sitemaps = [

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

services/site/AGENTS.md says /sitemap.xml is the only sitemap in robots.txt, and the other sitemaps are listed in sitemapFiles in src/lib/sitemap.ts, the index that already has /console/sitemap.xml. Adding the 17 /<locale>/console/sitemap.xml entries to sitemapFiles would keep that single entry point, avoid changing the robots.txt layout and its tests, and keep every sitemap in one list. If you keep them in robots.txt on purpose, please update AGENTS.md and the comment on sitemapFiles to match.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

moved the 17 entries into sitemapFiles next to /console/sitemap.xml, so robots.txt is unchanged. head cf6a7c7

@MrMushrooooom

Copy link
Copy Markdown
Contributor Author

moved the 17 localized Console sitemaps into sitemapFiles and made legacy /go, /zen and /enterprise keep their locale. head cf6a7c7

@opencodejr opencodejr Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Both earlier points are fixed. The localized Console sitemaps now live in sitemapFiles in src/lib/sitemap.ts, and robots.txt is back to listing only /sitemap.xml. The old /<locale>/go, /<locale>/zen and /<locale>/enterprise redirects now keep their language, while English URLs and other old paths such as /de/pricing are unchanged. I checked this with the legacy, sitemap, console-links and robots-txt tests (27 pass), the full site suite (255 pass) and typecheck:tsc (clean).

Public API: unchanged. The new commits only change the site's sitemap index and its old-URL redirects.

I found nothing new.

@adamdotdevin adamdotdevin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Range-diff: the links commit is unchanged apart from rebase context, the robots.txt commit is replaced by the sitemap index entries, and the legacy redirects now keep the locale through consoleRoute (exact paths still, so /zen/v1/* is untouched). The Console's localized pages are live now (opencode-console#9155/#9183 deployed 20:23Z), so this is good to merge. LGTM.

@MrMushrooooom
MrMushrooooom merged commit 68ea328 into dev Nov 27, 2026
13 checks passed
@MrMushrooooom
MrMushrooooom deleted the site-console-links branch November 27, 2026 20:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants