Skip to content

Commit 78930be

Browse files
committed
use local url during dev so opengraph loads locally too
1 parent 0104c7d commit 78930be

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/components/BaseHead.astro

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@ interface Props {
77
88
import { withBase } from "../lib/utils";
99
const { title, description = "The official blog of the Python core development team.", image } = Astro.props;
10+
const baseUrl = import.meta.env.DEV ? Astro.url.origin : Astro.site;
1011
const canonicalURL = new URL(Astro.url.pathname, Astro.site);
11-
const ogImage = image ? new URL(image, Astro.site) : new URL(withBase("/og-default.png"), Astro.site);
12+
const ogImage = image ? new URL(image, baseUrl) : new URL(withBase("/og-default.png"), baseUrl);
1213
---
1314

1415
<meta charset="utf-8" />

0 commit comments

Comments
 (0)