mirror of
https://github.com/sst/opencode.git
synced 2025-08-30 17:57:25 +00:00
docs: dynamic domain
This commit is contained in:
parent
c51de945a5
commit
facd851b11
4 changed files with 7 additions and 5 deletions
|
@ -39,6 +39,7 @@ new sst.cloudflare.x.Astro("Web", {
|
||||||
domain,
|
domain,
|
||||||
path: "packages/web",
|
path: "packages/web",
|
||||||
environment: {
|
environment: {
|
||||||
|
// For astro config
|
||||||
SST_STAGE: $app.stage,
|
SST_STAGE: $app.stage,
|
||||||
VITE_API_URL: api.url,
|
VITE_API_URL: api.url,
|
||||||
},
|
},
|
||||||
|
|
|
@ -9,12 +9,13 @@ import { rehypeHeadingIds } from "@astrojs/markdown-remark"
|
||||||
import rehypeAutolinkHeadings from "rehype-autolink-headings"
|
import rehypeAutolinkHeadings from "rehype-autolink-headings"
|
||||||
|
|
||||||
const github = "https://github.com/sst/opencode"
|
const github = "https://github.com/sst/opencode"
|
||||||
|
const stage = process.env.SST_STAGE || "dev"
|
||||||
console.log("stage", process.env.SST_STAGE)
|
|
||||||
|
|
||||||
// https://astro.build/config
|
// https://astro.build/config
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
site: config.url,
|
site: stage === "production"
|
||||||
|
? `https://${config.domain}`
|
||||||
|
: `https://${stage}.${config.domain}`,
|
||||||
output: "server",
|
output: "server",
|
||||||
adapter: cloudflare({
|
adapter: cloudflare({
|
||||||
imageService: "passthrough",
|
imageService: "passthrough",
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
export default {
|
export default {
|
||||||
url: "https://opencode.ai",
|
domain: "opencode.ai",
|
||||||
socialCard: "https://social-cards.sst.dev",
|
socialCard: "https://social-cards.sst.dev",
|
||||||
github: "https://github.com/sst/opencode",
|
github: "https://github.com/sst/opencode",
|
||||||
discord: "https://discord.gg/opencode",
|
discord: "https://discord.gg/opencode",
|
||||||
|
|
|
@ -13,7 +13,7 @@ const {
|
||||||
const isDocs = slug.startsWith("docs")
|
const isDocs = slug.startsWith("docs")
|
||||||
|
|
||||||
let encodedTitle = '';
|
let encodedTitle = '';
|
||||||
let ogImage = `${config.url}/social-share.png`;
|
let ogImage = `https://${config.domain}/social-share.png`;
|
||||||
let truncatedDesc = '';
|
let truncatedDesc = '';
|
||||||
|
|
||||||
if (isDocs) {
|
if (isDocs) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue