Repository navigation
feat(site): link to the Console pages in the page's language - #66852
Conversation
adamdotdevin
left a comment
There was a problem hiding this comment.
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:
consoleMarketingPathmatches 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
pageLocaleandpage-markdown.tsreformats are unrelated. - Naming the param
consoleshadows the global.
Needs a rebase on #66772 (conflict in language.ts).
3592656 to
ce7556a
Compare
|
@adamdotdevin rebased onto #66772 (shared-locale), exact-match links, param/comment/reformat fixes, plus the 17 localized Console sitemaps in robots.txt. head ce7556a |
ce7556a to
b85d759
Compare
The base branch was changed.
There was a problem hiding this comment.
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, butservices/site/AGENTS.mdsays/sitemap.xmlis the only sitemap listed there, and the other sitemaps belong insitemapFiles(src/lib/sitemap.ts). See the inline comment. - Non-blocking:
localizedMovesinsrc/lib/legacy.tsstill sends/<locale>/go,/<locale>/zenand/<locale>/enterpriseto 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.
| 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 = [ |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
moved the 17 entries into sitemapFiles next to /console/sitemap.xml, so robots.txt is unchanged. head cf6a7c7
b85d759 to
cf6a7c7
Compare
|
moved the 17 localized Console sitemaps into sitemapFiles and made legacy /go, /zen and /enterprise keep their locale. head cf6a7c7 |
There was a problem hiding this comment.
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
left a comment
There was a problem hiding this comment.
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.
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/workspacestay 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.tsasserts thatlocalized("/console")stays false and that the middleware's redirect target remains/console.Adds the 17 localized Console sitemaps (
/<locale>/console/sitemap.xml) tositemapFiles, next to the existing English/console/sitemap.xml, so crawlers reach them from/sitemap.xml, the one sitemaprobots.txtlists.test/sitemap.test.tschecks every localized entry.Legacy
/<locale>/go,/<locale>/zenand/<locale>/enterprisenow redirect to the matching/<locale>/console/...page instead of English; English URLs are unchanged.test/legacy.test.tscovers 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 includingcheck-worker-start.