fix(site): use custom domain for og:image on production deploys (#880)

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Darius Cepulis
2026-03-10 19:28:26 -05:00
committed by GitHub
co-authored by Claude Opus 4.6
parent 31604e5785
commit f168256848
2 changed files with 7 additions and 6 deletions
+6 -5
View File
@@ -17,14 +17,15 @@ import remarkConditionalHeadings from './src/utils/remarkConditionalHeadings';
import { remarkReadingTime } from './src/utils/remarkReadingTime.mjs';
import shikiTransformMetadata from './src/utils/shikiTransformMetadata';
// Astro docs say `site` should be "your final, deployed URL", but we override
// it per-deploy so that generated absolute URLs (OG images, RSS, etc.) resolve
// correctly on Netlify deploy previews. On production, DEPLOY_PRIME_URL is the
// primary site URL so it's equivalent.
// On production deploys, use the custom domain — DEPLOY_PRIME_URL always returns
// the Netlify subdomain (e.g. main--vjs10-site.netlify.app), not the custom
// domain. On deploy previews, use DEPLOY_PRIME_URL so OG images point to a
// reachable URL for crawlers.
//
// For URLs that must always point to production regardless of deploy context
// (e.g. canonical, JSON-LD), use PRODUCTION_URL from src/consts.ts instead.
const SITE_URL = process.env.DEPLOY_PRIME_URL || 'https://videojs.org';
const SITE_URL =
process.env.CONTEXT === 'production' ? 'https://videojs.org' : process.env.DEPLOY_PRIME_URL || 'https://videojs.org';
// https://astro.build/config
export default defineConfig({
+1 -1
View File
@@ -2,7 +2,7 @@
"$schema": "https://turbo.build/schema.json",
"ui": "stream",
"concurrency": "20",
"globalEnv": ["DEPLOY_PRIME_URL"],
"globalEnv": ["CONTEXT", "DEPLOY_PRIME_URL"],
"tasks": {
"build": {
"dependsOn": ["^build"],