From 0f93ecd564c87cefba40b779c9f35d0930719b67 Mon Sep 17 00:00:00 2001 From: Jay V Date: Mon, 7 Jul 2025 16:36:52 -0400 Subject: [PATCH] docs: canonical url --- packages/web/astro.config.mjs | 5 +---- packages/web/config.mjs | 6 +++++- packages/web/src/components/Head.astro | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/packages/web/astro.config.mjs b/packages/web/astro.config.mjs index 538784acf..63b93b9d8 100644 --- a/packages/web/astro.config.mjs +++ b/packages/web/astro.config.mjs @@ -9,13 +9,10 @@ import { rehypeHeadingIds } from "@astrojs/markdown-remark" import rehypeAutolinkHeadings from "rehype-autolink-headings" const github = "https://github.com/sst/opencode" -const stage = process.env.SST_STAGE || "dev" // https://astro.build/config export default defineConfig({ - site: stage === "production" - ? `https://${config.domain}` - : `https://${stage}.${config.domain}`, + site: config.url, output: "server", adapter: cloudflare({ imageService: "passthrough", diff --git a/packages/web/config.mjs b/packages/web/config.mjs index f0ae3cb61..5e4c571d2 100644 --- a/packages/web/config.mjs +++ b/packages/web/config.mjs @@ -1,5 +1,9 @@ +const stage = process.env.SST_STAGE || "dev" + export default { - domain: "opencode.ai", + url: stage === "production" + ? "https://opencode.ai" + : `https://${stage}.opencode.ai`, socialCard: "https://social-cards.sst.dev", github: "https://github.com/sst/opencode", discord: "https://discord.gg/opencode", diff --git a/packages/web/src/components/Head.astro b/packages/web/src/components/Head.astro index 9ebf734cd..f6166f58f 100644 --- a/packages/web/src/components/Head.astro +++ b/packages/web/src/components/Head.astro @@ -13,7 +13,7 @@ const { const isDocs = slug.startsWith("docs") let encodedTitle = ''; -let ogImage = `https://${config.domain}/social-share.png`; +let ogImage = `${config.url}/social-share.png`; let truncatedDesc = ''; if (isDocs) {