feat(www): locale specific urls (#12508)

This commit is contained in:
Adam
2026-02-06 11:30:40 -06:00
committed by GitHub
parent 8069197329
commit 24cd84cda5
33 changed files with 279 additions and 134 deletions

View File

@@ -1,5 +1,5 @@
import "./index.css"
import { Title, Meta, Link } from "@solidjs/meta"
import { Title, Meta } from "@solidjs/meta"
//import { HttpHeader } from "@solidjs/start"
import video from "../asset/lander/opencode-min.mp4"
import videoPoster from "../asset/lander/opencode-poster.png"
@@ -15,6 +15,8 @@ import { github } from "~/lib/github"
import { createMemo } from "solid-js"
import { config } from "~/config"
import { useI18n } from "~/context/i18n"
import { useLanguage } from "~/context/language"
import { LocaleLinks } from "~/component/locale-links"
function CopyStatus() {
return (
@@ -27,6 +29,7 @@ function CopyStatus() {
export default function Home() {
const i18n = useI18n()
const language = useLanguage()
const githubData = createAsync(() => github())
const release = createMemo(() => githubData()?.release)
@@ -46,7 +49,7 @@ export default function Home() {
<main data-page="opencode">
{/*<HttpHeader name="Cache-Control" value="public, max-age=1, s-maxage=3600, stale-while-revalidate=86400" />*/}
<Title>{i18n.t("home.title")}</Title>
<Link rel="canonical" href={config.baseUrl} />
<LocaleLinks path="/" />
<Meta property="og:image" content="/social-share.png" />
<Meta name="twitter:image" content="/social-share.png" />
<div data-component="container">
@@ -61,10 +64,10 @@ export default function Home() {
{i18n.t("home.banner.text")}
<span data-slot="platforms"> {i18n.t("home.banner.platforms")}</span>.
</span>
<a href="/download" data-slot="link">
<a href={language.route("/download")} data-slot="link">
{i18n.t("home.banner.downloadNow")}
</a>
<a href="/download" data-slot="link-mobile">
<a href={language.route("/download")} data-slot="link-mobile">
{i18n.t("home.banner.downloadBetaNow")}
</a>
</div>
@@ -217,7 +220,7 @@ export default function Home() {
</div>
</li>
</ul>
<a href="/docs">
<a href={language.route("/docs")}>
<span>{i18n.t("home.what.readDocs")} </span>
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path
@@ -657,7 +660,7 @@ export default function Home() {
<p>
{i18n.t("home.privacy.body")} {i18n.t("home.privacy.learnMore")}{" "}
<a href="/docs/enterprise/">{i18n.t("home.privacy.link")}</a>.
<a href={language.route("/docs/enterprise/")}>{i18n.t("home.privacy.link")}</a>.
</p>
</div>
</div>
@@ -673,14 +676,15 @@ export default function Home() {
</li>
<li>
<Faq question={i18n.t("home.faq.q2")}>
{i18n.t("home.faq.a2.before")} <a href="/docs">{i18n.t("home.faq.a2.link")}</a>.
{i18n.t("home.faq.a2.before")} <a href={language.route("/docs")}>{i18n.t("home.faq.a2.link")}</a>.
</Faq>
</li>
<li>
<Faq question={i18n.t("home.faq.q3")}>
{i18n.t("home.faq.a3.p1")} {i18n.t("home.faq.a3.p2.beforeZen")} <A href="/zen">{i18n.t("nav.zen")}</A>
{i18n.t("home.faq.a3.p1")} {i18n.t("home.faq.a3.p2.beforeZen")}{" "}
<A href={language.route("/zen")}>{i18n.t("nav.zen")}</A>
{i18n.t("home.faq.a3.p2.afterZen")} {i18n.t("home.faq.a3.p3")} {i18n.t("home.faq.a3.p4.beforeLocal")}{" "}
<a href="/docs/providers/#lm-studio" target="_blank">
<a href={language.route("/docs/providers/#lm-studio")} target="_blank">
{i18n.t("home.faq.a3.p4.localLink")}
</a>
.
@@ -688,13 +692,15 @@ export default function Home() {
</li>
<li>
<Faq question={i18n.t("home.faq.q4")}>
{i18n.t("home.faq.a4.p1")} <a href="/docs/providers/#directory">{i18n.t("common.learnMore")}</a>.
{i18n.t("home.faq.a4.p1")}{" "}
<a href={language.route("/docs/providers/#directory")}>{i18n.t("common.learnMore")}</a>.
</Faq>
</li>
<li>
<Faq question={i18n.t("home.faq.q5")}>
{i18n.t("home.faq.a5.beforeDesktop")} <a href="/download">{i18n.t("home.faq.a5.desktop")}</a>{" "}
{i18n.t("home.faq.a5.and")} <a href="/docs/web">{i18n.t("home.faq.a5.web")}</a>!
{i18n.t("home.faq.a5.beforeDesktop")}{" "}
<a href={language.route("/download")}>{i18n.t("home.faq.a5.desktop")}</a> {i18n.t("home.faq.a5.and")}{" "}
<a href={language.route("/docs/web")}>{i18n.t("home.faq.a5.web")}</a>!
</Faq>
</li>
<li>
@@ -703,8 +709,9 @@ export default function Home() {
<li>
<Faq question={i18n.t("home.faq.q7")}>
{i18n.t("home.faq.a7.p1")} {i18n.t("home.faq.a7.p2.beforeModels")}{" "}
<a href="/docs/zen/#privacy">{i18n.t("home.faq.a7.p2.modelsLink")}</a> {i18n.t("home.faq.a7.p2.and")}{" "}
<a href="/docs/share/#privacy">{i18n.t("home.faq.a7.p2.shareLink")}</a>.
<a href={language.route("/docs/zen/#privacy")}>{i18n.t("home.faq.a7.p2.modelsLink")}</a>{" "}
{i18n.t("home.faq.a7.p2.and")}{" "}
<a href={language.route("/docs/share/#privacy")}>{i18n.t("home.faq.a7.p2.shareLink")}</a>.
</Faq>
</li>
<li>
@@ -808,7 +815,7 @@ export default function Home() {
</svg>
</div>
</div>
<A href="/zen">
<A href={language.route("/zen")}>
<span>{i18n.t("home.zenCta.link")} </span>
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path