mirror of
https://github.com/anomalyco/opencode.git
synced 2026-11-29 03:24:54 +00:00
fix(console): give marketing pages complete social preview tags (#56565)
This commit is contained in:
parent
3921f777ed
commit
736d2fe948
9 changed files with 51 additions and 32 deletions
23
packages/console/app/src/component/social-meta.tsx
Normal file
23
packages/console/app/src/component/social-meta.tsx
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
import { Meta } from "@solidjs/meta"
|
||||
import { config } from "~/config"
|
||||
import { useLanguage } from "~/context/language"
|
||||
|
||||
export function SocialMeta(props: { title: string; description: string; path: string; image?: string }) {
|
||||
const language = useLanguage()
|
||||
const image = () => `${config.baseUrl}${props.image ?? "/social-share.png"}`
|
||||
return (
|
||||
<>
|
||||
<Meta property="og:type" content="website" />
|
||||
<Meta property="og:site_name" content="OpenCode" />
|
||||
<Meta property="og:url" content={`${config.baseUrl}${language.route(props.path)}`} />
|
||||
<Meta property="og:title" content={props.title} />
|
||||
<Meta property="og:description" content={props.description} />
|
||||
<Meta property="og:image" content={image()} />
|
||||
<Meta name="twitter:card" content="summary_large_image" />
|
||||
<Meta name="twitter:site" content="@opencode" />
|
||||
<Meta name="twitter:title" content={props.title} />
|
||||
<Meta name="twitter:description" content={props.description} />
|
||||
<Meta name="twitter:image" content={image()} />
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
|
@ -17,8 +17,6 @@ export default createHandler(
|
|||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<meta property="og:image" content="/social-share.png" />
|
||||
<meta property="twitter:image" content="/social-share.png" />
|
||||
<style>{criticalCSS}</style>
|
||||
{assets}
|
||||
</head>
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import { LanguagePicker } from "~/component/language-picker"
|
|||
import { useI18n } from "~/context/i18n"
|
||||
import Spotlight, { defaultConfig, type SpotlightAnimationState } from "~/component/spotlight"
|
||||
import { LocaleLinks } from "~/component/locale-links"
|
||||
import { SocialMeta } from "~/component/social-meta"
|
||||
import "./black.css"
|
||||
|
||||
export default function BlackLayout(props: RouteSectionProps) {
|
||||
|
|
@ -72,15 +73,12 @@ export default function BlackLayout(props: RouteSectionProps) {
|
|||
<Title>{i18n.t("black.meta.title")}</Title>
|
||||
<Meta name="description" content={i18n.t("black.meta.description")} />
|
||||
<LocaleLinks path="/black" />
|
||||
<Meta property="og:type" content="website" />
|
||||
<Meta property="og:url" content={`${config.baseUrl}${language.route("/black")}`} />
|
||||
<Meta property="og:title" content={i18n.t("black.meta.title")} />
|
||||
<Meta property="og:description" content={i18n.t("black.meta.description")} />
|
||||
<Meta property="og:image" content="/social-share-black.png" />
|
||||
<Meta name="twitter:card" content="summary_large_image" />
|
||||
<Meta name="twitter:title" content={i18n.t("black.meta.title")} />
|
||||
<Meta name="twitter:description" content={i18n.t("black.meta.description")} />
|
||||
<Meta name="twitter:image" content="/social-share-black.png" />
|
||||
<SocialMeta
|
||||
title={i18n.t("black.meta.title")}
|
||||
description={i18n.t("black.meta.description")}
|
||||
path="/black"
|
||||
image="/social-share-black.png"
|
||||
/>
|
||||
|
||||
<Spotlight config={spotlightConfig} class="header-spotlight" onAnimationFrame={handleAnimationFrame} />
|
||||
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import { Footer } from "~/component/footer"
|
|||
import { Legal } from "~/component/legal"
|
||||
import { useI18n } from "~/context/i18n"
|
||||
import { LocaleLinks } from "~/component/locale-links"
|
||||
import { SocialMeta } from "~/component/social-meta"
|
||||
import previewLogoLight from "../../asset/brand/preview-opencode-logo-light.png"
|
||||
import previewLogoDark from "../../asset/brand/preview-opencode-logo-dark.png"
|
||||
import previewLogoLightSquare from "../../asset/brand/preview-opencode-logo-light-square.png"
|
||||
|
|
@ -65,6 +66,7 @@ export default function Brand() {
|
|||
<Title>{i18n.t("brand.title")}</Title>
|
||||
<LocaleLinks path="/brand" />
|
||||
<Meta name="description" content={i18n.t("brand.meta.description")} />
|
||||
<SocialMeta title={i18n.t("brand.title")} description={i18n.t("brand.meta.description")} path="/brand" />
|
||||
<div data-component="container">
|
||||
<Header />
|
||||
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import { Header } from "~/component/header"
|
|||
import { IconCheck, IconCopy } from "~/component/icon"
|
||||
import { Legal } from "~/component/legal"
|
||||
import { LocaleLinks } from "~/component/locale-links"
|
||||
import { SocialMeta } from "~/component/social-meta"
|
||||
import { config } from "~/config"
|
||||
import { useI18n } from "~/context/i18n"
|
||||
import { useLanguage } from "~/context/language"
|
||||
|
|
@ -41,6 +42,7 @@ export default function Download() {
|
|||
<Title>{i18n.t("download.title")}</Title>
|
||||
<LocaleLinks path="/download" />
|
||||
<Meta name="description" content={i18n.t("download.meta.description")} />
|
||||
<SocialMeta title={i18n.t("download.title")} description={i18n.t("download.meta.description")} path="/download" />
|
||||
<div data-component="container">
|
||||
<Header hideGetStarted />
|
||||
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import { Legal } from "~/component/legal"
|
|||
import { Faq } from "~/component/faq"
|
||||
import { useI18n } from "~/context/i18n"
|
||||
import { LocaleLinks } from "~/component/locale-links"
|
||||
import { SocialMeta } from "~/component/social-meta"
|
||||
import { inferenceSpendOptions } from "~/lib/inference-spend"
|
||||
|
||||
export default function Enterprise() {
|
||||
|
|
@ -76,6 +77,7 @@ export default function Enterprise() {
|
|||
<Title>{i18n.t("enterprise.title")}</Title>
|
||||
<LocaleLinks path="/enterprise" />
|
||||
<Meta name="description" content={i18n.t("enterprise.meta.description")} />
|
||||
<SocialMeta title={i18n.t("enterprise.title")} description={i18n.t("enterprise.meta.description")} path="/enterprise" />
|
||||
<div data-component="container">
|
||||
<Header />
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@ import { Legal } from "~/component/legal"
|
|||
import { Footer } from "~/component/footer"
|
||||
import { Header } from "~/component/header"
|
||||
import { GoPlanChart } from "~/component/go-plan-chart"
|
||||
import { config } from "~/config"
|
||||
import {
|
||||
IconAlibaba,
|
||||
IconAnthropic,
|
||||
|
|
@ -27,8 +26,8 @@ import {
|
|||
IconZai,
|
||||
} from "~/component/icon"
|
||||
import { useI18n } from "~/context/i18n"
|
||||
import { useLanguage } from "~/context/language"
|
||||
import { LocaleLinks } from "~/component/locale-links"
|
||||
import { SocialMeta } from "~/component/social-meta"
|
||||
|
||||
const models = [
|
||||
{ name: "Space Bunny", training: "go.faq.a5.notUsed", retention: "go.faq.a5.retention0" },
|
||||
|
|
@ -65,7 +64,6 @@ const models = [
|
|||
export default function Home() {
|
||||
const subscribeUrl = "https://opencode.ai/console/go"
|
||||
const i18n = useI18n()
|
||||
const language = useLanguage()
|
||||
const [searchParams] = useSearchParams()
|
||||
return (
|
||||
<main data-page="go">
|
||||
|
|
@ -73,21 +71,12 @@ export default function Home() {
|
|||
<Title>{i18n.t("go.title")}</Title>
|
||||
<Meta name="description" content={`${i18n.t("go.meta.description")} ${i18n.t("go.plans.plus.description")}`} />
|
||||
<LocaleLinks path="/go" />
|
||||
<Meta property="og:type" content="website" />
|
||||
<Meta property="og:url" content={`${config.baseUrl}${language.route("/go")}`} />
|
||||
<Meta property="og:title" content={i18n.t("go.title")} />
|
||||
<Meta
|
||||
property="og:description"
|
||||
content={`${i18n.t("go.meta.description")} ${i18n.t("go.plans.plus.description")}`}
|
||||
<SocialMeta
|
||||
title={i18n.t("go.title")}
|
||||
description={`${i18n.t("go.meta.description")} ${i18n.t("go.plans.plus.description")}`}
|
||||
path="/go"
|
||||
image="/social-share-black.png"
|
||||
/>
|
||||
<Meta property="og:image" content="/social-share-black.png" />
|
||||
<Meta name="twitter:card" content="summary_large_image" />
|
||||
<Meta name="twitter:title" content={i18n.t("go.title")} />
|
||||
<Meta
|
||||
name="twitter:description"
|
||||
content={`${i18n.t("go.meta.description")} ${i18n.t("go.plans.plus.description")}`}
|
||||
/>
|
||||
<Meta name="twitter:image" content="/social-share-black.png" />
|
||||
|
||||
<div data-component="container">
|
||||
<Header go hideGetStarted />
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ import { config } from "~/config"
|
|||
import { useI18n } from "~/context/i18n"
|
||||
import { useLanguage } from "~/context/language"
|
||||
import { LocaleLinks } from "~/component/locale-links"
|
||||
import { SocialMeta } from "~/component/social-meta"
|
||||
|
||||
function CopyStatus() {
|
||||
return (
|
||||
|
|
@ -48,8 +49,7 @@ export default function Home() {
|
|||
<Title>{i18n.t("home.title")}</Title>
|
||||
<Meta name="description" content={i18n.t("app.meta.description")} />
|
||||
<LocaleLinks path="/" />
|
||||
<Meta property="og:image" content="/social-share.png" />
|
||||
<Meta name="twitter:image" content="/social-share.png" />
|
||||
<SocialMeta title={i18n.t("home.title")} description={i18n.t("app.meta.description")} path="/" />
|
||||
<div data-component="container">
|
||||
<Header />
|
||||
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ import { IconGemini, IconMiniMax, IconZai } from "~/component/icon"
|
|||
import { useI18n } from "~/context/i18n"
|
||||
import { useLanguage } from "~/context/language"
|
||||
import { LocaleLinks } from "~/component/locale-links"
|
||||
import { SocialMeta } from "~/component/social-meta"
|
||||
|
||||
export default function Home() {
|
||||
const i18n = useI18n()
|
||||
|
|
@ -30,8 +31,12 @@ export default function Home() {
|
|||
<Title>{i18n.t("zen.title")}</Title>
|
||||
<Meta name="description" content={i18n.t("zen.hero.body")} />
|
||||
<LocaleLinks path="/zen" />
|
||||
<Meta property="og:image" content="/social-share-zen.png" />
|
||||
<Meta name="twitter:image" content="/social-share-zen.png" />
|
||||
<SocialMeta
|
||||
title={i18n.t("zen.title")}
|
||||
description={i18n.t("zen.hero.body")}
|
||||
path="/zen"
|
||||
image="/social-share-zen.png"
|
||||
/>
|
||||
|
||||
<div data-component="container">
|
||||
<Header zen hideGetStarted />
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue