Skip to content

Commit bd9997e

Browse files
committed
Fix OG image URL to use VERCEL_PROJECT_PRODUCTION_URL
Use production domain for OG images instead of deployment-specific URL
1 parent 6013406 commit bd9997e

3 files changed

Lines changed: 8 additions & 3 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ npx create-unmint@latest my-docs
3333

3434
</td>
3535
</tr>
36-
</table>
36+
</table>`
3737

3838
</div>
3939

packages/create-unmint/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "create-unmint",
3-
"version": "1.3.3",
3+
"version": "1.3.4",
44
"description": "Create a new Unmint documentation project",
55
"type": "module",
66
"bin": {

packages/template/lib/theme-config.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,13 +90,18 @@ export function getCSSVariables(mode: 'light' | 'dark') {
9090

9191
/**
9292
* Get the site URL dynamically
93-
* Priority: NEXT_PUBLIC_SITE_URL > VERCEL_URL > siteConfig.url
93+
* Priority: NEXT_PUBLIC_SITE_URL > VERCEL_PROJECT_PRODUCTION_URL > VERCEL_URL > siteConfig.url
9494
* This allows OG images to work automatically on Vercel without configuration
9595
*/
9696
export function getSiteUrl(): string {
9797
if (process.env.NEXT_PUBLIC_SITE_URL) {
9898
return process.env.NEXT_PUBLIC_SITE_URL
9999
}
100+
// Use production URL if available (custom domain)
101+
if (process.env.VERCEL_PROJECT_PRODUCTION_URL) {
102+
return `https://${process.env.VERCEL_PROJECT_PRODUCTION_URL}`
103+
}
104+
// Fallback to deployment URL for preview deployments
100105
if (process.env.VERCEL_URL) {
101106
return `https://${process.env.VERCEL_URL}`
102107
}

0 commit comments

Comments
 (0)