mirror of
https://github.com/anomalyco/opencode.git
synced 2026-11-20 18:57:17 +03:00
fix(site): remove the home page faq (#62461)
This commit is contained in:
@@ -118,7 +118,7 @@ export const copyVariants = {
|
||||
"Used by developers at",
|
||||
],
|
||||
},
|
||||
// Home sections and FAQ answers without copy of their own in Design mode until the coding-agents
|
||||
// Home sections without copy of their own in Design mode until the coding-agents
|
||||
// review (positioningRec). One line each: editing reads the whole text, links included. Links in
|
||||
// an option come from homeContent's copyLinks phrases.
|
||||
"home.feature.anyModel.body": {
|
||||
@@ -146,32 +146,6 @@ export const copyVariants = {
|
||||
`OpenCode is MIT licensed. ${config.stats.contributors} contributors have made ${config.stats.commits}+ commits, and ${config.stats.monthlyUsers} developers use it every month.`,
|
||||
],
|
||||
},
|
||||
"home.faq.a3": {
|
||||
label: "FAQ: extra subscriptions",
|
||||
lines: 1,
|
||||
options: [
|
||||
"No. OpenCode includes free models that need no account. You can also connect any of 200+ providers, sign in with ChatGPT or Copilot, or run local models.",
|
||||
],
|
||||
},
|
||||
"home.faq.a4": {
|
||||
label: "FAQ: existing subscriptions",
|
||||
lines: 1,
|
||||
options: ["Yes. Sign in with ChatGPT (Plus or Pro) or GitHub Copilot, including GitHub Enterprise."],
|
||||
},
|
||||
"home.faq.a6": {
|
||||
label: "FAQ: cost",
|
||||
lines: 1,
|
||||
options: [
|
||||
"OpenCode is free and MIT licensed. The free models cost nothing. With another provider, you pay that provider. OpenCode Go is from $10/month, and OpenCode Models are pay as you go.",
|
||||
],
|
||||
},
|
||||
"home.faq.a7": {
|
||||
label: "FAQ: data and privacy",
|
||||
lines: 1,
|
||||
options: [
|
||||
"OpenCode runs on your computer and keeps your sessions there. Your code goes only to the model provider you choose. If you choose a model hosted by OpenCode, its training and retention terms are listed in the docs.",
|
||||
],
|
||||
},
|
||||
// The home page's "New" bar (announcement.ts): each option keeps its own link.
|
||||
"home.announcement": { label: "Announcement", lines: 1, options: announcements.map(announcementCopy) },
|
||||
// "Get started" (lib/get-started.ts); the first option is the page's own copy.
|
||||
|
||||
@@ -271,7 +271,6 @@ const settingControls: Record<string, Control> = {
|
||||
whatColumns: setting("whatColumns", "Body columns", () => sectionColumns),
|
||||
toolsColumns: setting("toolsColumns", "Body columns", () => sectionColumns),
|
||||
openSourceColumns: setting("openSourceColumns", "Body columns", () => sectionColumns),
|
||||
faqColumns: setting("faqColumns", "FAQ width", () => sectionColumns),
|
||||
consoleColumns: setting("consoleColumns", "Body columns", () => sectionColumns),
|
||||
whatCopyColumns: setting("whatCopyColumns", "Copy columns", () => sectionColumns),
|
||||
toolsCopyColumns: setting("toolsCopyColumns", "Copy columns", () => sectionColumns),
|
||||
|
||||
@@ -27,7 +27,6 @@ const selectors: Record<HomeSection, string> = {
|
||||
tools: '[data-section="tools"]',
|
||||
// Open source proof as its own section moves with the stats, right after them.
|
||||
openSource: ':is([data-section="openSource"], [data-section="openSourceProof"])',
|
||||
faq: '[data-section="faq"]',
|
||||
console: '[data-section="console"]',
|
||||
}
|
||||
|
||||
@@ -39,7 +38,6 @@ const labels: Record<HomeSection, string> = {
|
||||
byos: "Bring your own subs",
|
||||
tools: "Bring your own tools",
|
||||
openSource: "Open source",
|
||||
faq: "FAQ",
|
||||
console: "Console",
|
||||
}
|
||||
|
||||
|
||||
@@ -76,7 +76,6 @@ const sectionColumnSettings = [
|
||||
{ key: "whatColumns", label: "What is OpenCode?", copy: "whatCopyColumns" },
|
||||
{ key: "toolsColumns", label: "Bring your own tools", copy: "toolsCopyColumns" },
|
||||
{ key: "openSourceColumns", label: "Open source", copy: "openSourceCopyColumns" },
|
||||
{ key: "faqColumns", label: "FAQ" },
|
||||
{ key: "consoleColumns", label: "Console", copy: "consoleCopyColumns" },
|
||||
] as const
|
||||
|
||||
@@ -573,18 +572,14 @@ export default function PageSettings(props: { home?: boolean; terminal?: boolean
|
||||
<For each={sectionColumnSettings}>
|
||||
{(item) => (
|
||||
<>
|
||||
<Show when={"copy" in item && item.copy}>
|
||||
{(copy) => (
|
||||
<SettingsSelect
|
||||
label={`${item.label} › Copy`}
|
||||
options={sectionColumns}
|
||||
value={siteSettings[copy()]}
|
||||
onChange={(value) => setSiteSetting(copy(), value)}
|
||||
/>
|
||||
)}
|
||||
</Show>
|
||||
<SettingsSelect
|
||||
label={"copy" in item ? `${item.label} › Body` : item.label}
|
||||
label={`${item.label} › Copy`}
|
||||
options={sectionColumns}
|
||||
value={siteSettings[item.copy]}
|
||||
onChange={(value) => setSiteSetting(item.copy, value)}
|
||||
/>
|
||||
<SettingsSelect
|
||||
label={`${item.label} › Body`}
|
||||
options={sectionColumns}
|
||||
value={siteSettings[item.key]}
|
||||
onChange={(value) => setSiteSetting(item.key, value)}
|
||||
|
||||
@@ -84,19 +84,6 @@ export function buildSearchIndex(
|
||||
href: route(path),
|
||||
target: { text: title },
|
||||
})
|
||||
const faq = (page: string, path: string) =>
|
||||
home.faq.items.map(
|
||||
(item): SearchItem => ({
|
||||
id: `faq:${path}:${item.question}`,
|
||||
group: "Sections",
|
||||
title: item.question,
|
||||
context: t("site.search.faq", { page }),
|
||||
body: plainRich(item.answer),
|
||||
keywords: "faq question",
|
||||
href: route(path),
|
||||
target: { faq: item.question },
|
||||
}),
|
||||
)
|
||||
|
||||
const pages: SearchItem[] = [
|
||||
{ title: names.home, path: "/", body: joinSentences([home.hero.title, ...home.hero.subtitle]) },
|
||||
@@ -161,7 +148,6 @@ export function buildSearchIndex(
|
||||
home.tools.items.map((i) => i.name).join(" "),
|
||||
),
|
||||
section(names.home, "/", home.openSource.title, stripTags(home.openSource.lead)),
|
||||
section(names.home, "/", home.faq.title, undefined, "questions"),
|
||||
section(names.home, "/", home.console.title, `${home.console.headline} ${home.console.body}`),
|
||||
]
|
||||
const productSections = productPages.flatMap((product) => [
|
||||
@@ -314,7 +300,6 @@ export function buildSearchIndex(
|
||||
...homeSections,
|
||||
...productSections,
|
||||
...downloadSections,
|
||||
...faq(names.home, "/"),
|
||||
...pressSections,
|
||||
...brandSections,
|
||||
...legalSections,
|
||||
|
||||
@@ -312,7 +312,6 @@
|
||||
"byos",
|
||||
"tools",
|
||||
"openSource",
|
||||
"faq",
|
||||
"console"
|
||||
],
|
||||
"toolTiles": "logo",
|
||||
@@ -346,7 +345,6 @@
|
||||
"whatColumns": "2 columns",
|
||||
"toolsColumns": "2 columns",
|
||||
"openSourceColumns": "2 columns",
|
||||
"faqColumns": "2 columns",
|
||||
"consoleColumns": "2 columns",
|
||||
"whatCopyColumns": "2 columns",
|
||||
"toolsCopyColumns": "2 columns",
|
||||
|
||||
@@ -173,7 +173,6 @@ export const homeSections = [
|
||||
"byos",
|
||||
"tools",
|
||||
"openSource",
|
||||
"faq",
|
||||
"console",
|
||||
] as const
|
||||
export type HomeSection = (typeof homeSections)[number]
|
||||
@@ -815,7 +814,7 @@ function createSchema() {
|
||||
ditherOpacity: z.number().min(10).max(100).catch(20),
|
||||
ditherCurve: z.number().min(1).max(4).catch(1),
|
||||
ditherLine: z.enum(toggles).catch("off"),
|
||||
// The Console section between the FAQ and the footer on the home page.
|
||||
// The Console section above the footer on the home page.
|
||||
consoleSection: z.enum(consoleSections).catch("panel"),
|
||||
consoleHeight: z.enum(consoleHeights).catch("compact"),
|
||||
consoleLabel: z.enum(consoleLabels).catch("left"),
|
||||
@@ -1043,7 +1042,6 @@ function createSchema() {
|
||||
whatColumns: z.enum(sectionColumns).catch("2 columns"),
|
||||
toolsColumns: z.enum(sectionColumns).catch("2 columns"),
|
||||
openSourceColumns: z.enum(sectionColumns).catch("2 columns"),
|
||||
faqColumns: z.enum(sectionColumns).catch("2 columns"),
|
||||
consoleColumns: z.enum(sectionColumns).catch("2 columns"),
|
||||
// The intro copy (lead or Console headline) beside the body columns above; the section body is
|
||||
// as wide as the wider of the two.
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { config } from "~/config"
|
||||
import type { RichText } from "~/lib/markdown"
|
||||
|
||||
// Structured data (https://schema.org) for search engines, one JSON-LD script per type.
|
||||
|
||||
@@ -93,21 +92,3 @@ export function breadcrumbData(items: { name: string; path: string }[]) {
|
||||
})),
|
||||
}
|
||||
}
|
||||
|
||||
/** The FAQ as plain text: link runs keep their text. */
|
||||
export function faqData(items: { question: string; answer: RichText }[]) {
|
||||
return {
|
||||
"@type": "FAQPage",
|
||||
mainEntity: items.map((item) => ({
|
||||
"@type": "Question",
|
||||
name: item.question,
|
||||
acceptedAnswer: {
|
||||
"@type": "Answer",
|
||||
text: item.answer
|
||||
.map((run) => (typeof run === "string" ? run : "code" in run ? run.code : run.text))
|
||||
.join("")
|
||||
.trim(),
|
||||
},
|
||||
})),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,9 +5,8 @@ import { rich } from "~/i18n/rich"
|
||||
import type { RichText } from "~/lib/markdown"
|
||||
|
||||
/**
|
||||
* The home page FAQ, which the product pages' download section shows too (lib/download-content.ts).
|
||||
* A module of its own, so the download section, on every page, doesn't take the rest of the home
|
||||
* page copy with it.
|
||||
* The FAQ in the product pages' download section (lib/download-content.ts). A module of its own, so
|
||||
* the download section, on every page, doesn't take the home page copy with it.
|
||||
*/
|
||||
export function homeFaq(t: Translate, route: (path: string) => string) {
|
||||
const docs = (path: string) => `https://opencode.ai${docsUrl(path)}`
|
||||
@@ -24,7 +23,6 @@ export function homeFaq(t: Translate, route: (path: string) => string) {
|
||||
},
|
||||
{
|
||||
question: t("home.faq.q3"),
|
||||
copy: "home.faq.a3",
|
||||
answer: rich(
|
||||
`${t("home.faq.a3.p1")} ${t("home.faq.a3.p4.beforeLocal")} ${t("home.faq.a3.providers")} ${t("home.faq.a3.models.after")}`,
|
||||
{ local: docs("/models/#local"), models: "https://opencode.ai/console/models" },
|
||||
@@ -32,7 +30,6 @@ export function homeFaq(t: Translate, route: (path: string) => string) {
|
||||
},
|
||||
{
|
||||
question: t("home.faq.q4"),
|
||||
copy: "home.faq.a4",
|
||||
answer: [`${t("home.faq.a4.p1")} `, { text: t("common.learnMore"), href: docs("/providers/") }, "."],
|
||||
},
|
||||
{
|
||||
@@ -43,10 +40,9 @@ export function homeFaq(t: Translate, route: (path: string) => string) {
|
||||
sdk: route("/sdk"),
|
||||
}),
|
||||
},
|
||||
{ question: t("home.faq.q6"), copy: "home.faq.a6", answer: [t("home.faq.a6")] },
|
||||
{ question: t("home.faq.q6"), answer: [t("home.faq.a6")] },
|
||||
{
|
||||
question: t("home.faq.q7"),
|
||||
copy: "home.faq.a7",
|
||||
answer: [
|
||||
`${t("home.faq.a7.p1")} ${t("home.faq.a7.p2.beforeModels")} `,
|
||||
{ text: t("home.faq.a7.p2.modelsLink"), href: docs("/console/models/#privacy") },
|
||||
@@ -67,6 +63,6 @@ export function homeFaq(t: Translate, route: (path: string) => string) {
|
||||
t("home.faq.a8.p3"),
|
||||
],
|
||||
},
|
||||
] satisfies { question: string; copy?: string; answer: RichText }[],
|
||||
] satisfies { question: string; answer: RichText }[],
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,6 @@ import { logoMetrics } from "~/component/site/logo-metrics"
|
||||
import type { Translate } from "~/i18n"
|
||||
import { rich } from "~/i18n/rich"
|
||||
import type { RichText } from "~/lib/markdown"
|
||||
import { homeFaq } from "~/lib/faq-content"
|
||||
|
||||
// Product order rule: whenever copy lists the products, name them in this order: desktop, mobile,
|
||||
// terminal, SDK (the order of `products` in component/site/product-data.ts).
|
||||
@@ -208,6 +207,5 @@ export function homeContent(t: Translate, route: (path: string) => string) {
|
||||
slimHeadline: t("home.console.slimHeadline"),
|
||||
sales: { text: t("home.console.sales"), href: "/console/enterprise" },
|
||||
},
|
||||
faq: homeFaq(t, route),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,8 +44,6 @@ export function homeMarkdown(context: MarkdownContext) {
|
||||
`## ${content.openSource.title}`,
|
||||
inlineHtmlToMarkdown(content.openSource.lead),
|
||||
content.openSource.stats.map((stat) => `- ${stat.label}: ${stat.value}`).join("\n"),
|
||||
`## ${content.faq.title}`,
|
||||
...content.faq.items.map((item) => blocks(`### ${item.question}`, richToMarkdown(item.answer)).trimEnd()),
|
||||
`## ${content.console.title}`,
|
||||
`**${content.console.headline}**`,
|
||||
content.console.body,
|
||||
|
||||
@@ -36,7 +36,7 @@ type PageMarkdown = {
|
||||
* negotiation, llms.txt and llms-full.txt all read this list.
|
||||
*/
|
||||
export const pageMarkdown: Record<string, PageMarkdown> = {
|
||||
"/": { title: "Home", description: "What OpenCode is, its apps, features and FAQ", markdown: homeMarkdown },
|
||||
"/": { title: "Home", description: "What OpenCode is, its apps and features", markdown: homeMarkdown },
|
||||
"/product": {
|
||||
title: "Product",
|
||||
description: "Every OpenCode product and extension, more open source from Anomaly, and every download",
|
||||
|
||||
@@ -41,12 +41,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
/* The FAQ always spans two card columns, whatever the section width setting, so its plus signs
|
||||
end on the third column's right edge. */
|
||||
&[data-site] [data-component="block"]:has([data-component="faq"]) [data-slot="body"] {
|
||||
max-width: var(--two-cards);
|
||||
}
|
||||
|
||||
/* "What is OpenCode?": ten features in five rows of two, one feature per card column, under the
|
||||
two-column lead. */
|
||||
&[data-site] [data-component="block"]:has([data-component="features"]) [data-slot="body"] {
|
||||
@@ -1200,7 +1194,7 @@
|
||||
}
|
||||
|
||||
/* No divider above, whatever the section spacer is (the second attribute outranks the spacer
|
||||
rules). The gap below the FAQ is half the "space" spacer's (David, 5 Nov: 184px to 92px, and
|
||||
rules). The gap above the Console is half the "space" spacer's (David, 5 Nov: 184px to 92px, and
|
||||
96px to 48px on phones). The "section" option keeps the spacer. */
|
||||
[data-page="home"][data-site] [data-component="block"][data-console]:not([data-console="section"]) {
|
||||
margin-top: calc(var(--block-space) + 1.25rem);
|
||||
|
||||
@@ -20,7 +20,6 @@ import {
|
||||
Suspense,
|
||||
Switch,
|
||||
} from "solid-js"
|
||||
import { Faq } from "~/component/faq"
|
||||
import { ConsoleField } from "~/component/site/console-field"
|
||||
import { ChevronRight, ExternalArrow } from "~/component/site/icons"
|
||||
import { LogoWall } from "~/component/site/logo-wall"
|
||||
@@ -49,7 +48,7 @@ import { isMobile } from "~/lib/platform"
|
||||
import { LocaleLinks } from "~/component/locale-links"
|
||||
import { ShareMeta } from "~/component/share-meta"
|
||||
import { ogImage } from "~/lib/og"
|
||||
import { faqData, JsonLd, organizationData, softwareData, websiteData } from "~/component/structured-data"
|
||||
import { JsonLd, organizationData, softwareData, websiteData } from "~/component/structured-data"
|
||||
import { Rich } from "~/component/site/rich-text"
|
||||
import { homeOrderDefaultCss, homeOrderScript, homeOrderStyleId, useHomeOrder } from "~/component/site/home-order"
|
||||
import { designCopy, designEditing } from "~/component/site/design-copy"
|
||||
@@ -217,7 +216,6 @@ export default function Home() {
|
||||
operatingSystem: "macOS, Windows, Linux",
|
||||
})}
|
||||
/>
|
||||
<JsonLd data={faqData(content().faq.items)} />
|
||||
|
||||
{/* The default section order from the server; a saved one (Design mode, development only)
|
||||
replaces it before the sections paint. */}
|
||||
@@ -449,37 +447,6 @@ export default function Home() {
|
||||
</section>
|
||||
</Show>
|
||||
|
||||
<section
|
||||
data-component="block"
|
||||
data-section="faq"
|
||||
data-design="faqColumns spacer spacerLength spacerCount spacerStartDash spacerStartGap spacerCurve ditherHeight ditherOrientation ditherDirection ditherLength ditherPixel ditherPattern ditherDensity ditherOpacity ditherCurve ditherLine"
|
||||
data-columns={siteSettings.faqColumns.charAt(0)}
|
||||
>
|
||||
<h2 data-slot="label">{content().faq.title}</h2>
|
||||
<div data-slot="body">
|
||||
<ul data-component="faq">
|
||||
<For each={content().faq.items}>
|
||||
{(item) => (
|
||||
<li>
|
||||
<Faq question={item.question}>
|
||||
<Show
|
||||
when={"copy" in item && item.copy ? (item.copy as CopyId) : undefined}
|
||||
fallback={<Rich value={item.answer} />}
|
||||
>
|
||||
{(copy) => (
|
||||
<span data-design-copy={copy()}>
|
||||
<Rich value={richCopy(copy(), item.answer, content().copyLinks)} />
|
||||
</span>
|
||||
)}
|
||||
</Show>
|
||||
</Faq>
|
||||
</li>
|
||||
)}
|
||||
</For>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section
|
||||
data-component="block"
|
||||
data-section="console"
|
||||
|
||||
Reference in New Issue
Block a user