mirror of
https://github.com/zoriya/v10.git
synced 2026-08-05 05:37:21 +00:00
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:
co-authored by
Claude Opus 4.6
parent
31604e5785
commit
f168256848
@@ -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
@@ -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"],
|
||||
|
||||
Reference in New Issue
Block a user