Skip to content

Commit 36520ea

Browse files
committed
social image
1 parent e53572a commit 36520ea

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/pages/index.astro

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,18 @@ import Splash from "~/components/splash.astro";
99
import Timetable from "~/components/timetable.astro";
1010
import "~/styles/index.css";
1111
import Suponsor from "~/components/suponsor.astro";
12+
import path from "path";
1213
1314
const { generator, site } = Astro;
1415
const description = "VS Code Conference Japan 2024 - 2024/04/20 Sat.";
1516
const title = "VS Code Conference Japan 2024";
17+
const socialImageUrl = new URL(
18+
path.join(
19+
import.meta.env.BASE_URL,
20+
"social.png",
21+
site?.toString() ?? "localhost:4321",
22+
),
23+
);
1624
---
1725

1826
<!doctype html>
@@ -35,7 +43,7 @@ const title = "VS Code Conference Japan 2024";
3543
<meta property="og:title" content={title} />
3644
<meta property="og:type" content="website" />
3745
<meta property="og:description" content={description} />
38-
<meta property="og:image" content=`${site}/${import.meta.env.BASE_URL}/social.png` />
46+
<meta property="og:image" content="socialImageUrl" />
3947
<meta property="og:url" content={site} />
4048
<meta name="twitter:card" content="summary" />
4149
<meta name="twitter:site" content="@vscodejp" />

0 commit comments

Comments
 (0)