Skip to content

Commit a706ef0

Browse files
committed
change
1 parent 56ae8d1 commit a706ef0

File tree

4 files changed

+56
-53
lines changed

4 files changed

+56
-53
lines changed

frontend/src/pages/api/[lang]/event/[slug]/social-card.tsx

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,20 @@ export const config = {
1111
unstable_allowDynamic: ["/node_modules/.pnpm/**"],
1212
};
1313

14-
const regularFont = fetch(
15-
new URL(
16-
"../../../../../social-card-font/GeneralSans-Regular.otf",
17-
import.meta.url,
18-
),
19-
).then((res) => res.arrayBuffer());
20-
const semiBoldFont = fetch(
21-
new URL(
22-
"../../../../../social-card-font/GeneralSans-Semibold.otf",
23-
import.meta.url,
24-
),
25-
).then((res) => res.arrayBuffer());
26-
2714
export const handler = async (req: NextRequest) => {
15+
const regularFont = fetch(
16+
new URL(
17+
"../../../../../social-card-font/GeneralSans-Regular.otf",
18+
import.meta.url,
19+
),
20+
).then((res) => res.arrayBuffer());
21+
const semiBoldFont = fetch(
22+
new URL(
23+
"../../../../../social-card-font/GeneralSans-Semibold.otf",
24+
import.meta.url,
25+
),
26+
).then((res) => res.arrayBuffer());
27+
2828
const client = createClient();
2929
const { searchParams } = new URL(req.url);
3030

frontend/src/pages/api/[lang]/keynotes/[slug]/social-card.tsx

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,20 @@ export const config = {
1111
unstable_allowDynamic: ["/node_modules/.pnpm/**"],
1212
};
1313

14-
const regularFont = fetch(
15-
new URL(
16-
"../../../../../social-card-font/GeneralSans-Regular.otf",
17-
import.meta.url,
18-
),
19-
).then((res) => res.arrayBuffer());
20-
const semiBoldFont = fetch(
21-
new URL(
22-
"../../../../../social-card-font/GeneralSans-Semibold.otf",
23-
import.meta.url,
24-
),
25-
).then((res) => res.arrayBuffer());
26-
2714
export const handler = async (req: NextRequest) => {
15+
const regularFont = fetch(
16+
new URL(
17+
"../../../../../social-card-font/GeneralSans-Regular.otf",
18+
import.meta.url,
19+
),
20+
).then((res) => res.arrayBuffer());
21+
const semiBoldFont = fetch(
22+
new URL(
23+
"../../../../../social-card-font/GeneralSans-Semibold.otf",
24+
import.meta.url,
25+
),
26+
).then((res) => res.arrayBuffer());
27+
2828
const regularFontData = await regularFont;
2929
const semiBoldFontData = await semiBoldFont;
3030
const client = createClient();

frontend/src/pages/api/[lang]/news/[slug]/social-card.tsx

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,20 @@ export const config = {
1111
unstable_allowDynamic: ["/node_modules/.pnpm/**"],
1212
};
1313

14-
const regularFont = fetch(
15-
new URL(
16-
"../../../../../social-card-font/GeneralSans-Regular.otf",
17-
import.meta.url,
18-
),
19-
).then((res) => res.arrayBuffer());
20-
const semiBoldFont = fetch(
21-
new URL(
22-
"../../../../../social-card-font/GeneralSans-Semibold.otf",
23-
import.meta.url,
24-
),
25-
).then((res) => res.arrayBuffer());
26-
2714
const handler = async (req: NextRequest) => {
15+
const regularFont = fetch(
16+
new URL(
17+
"../../../../../social-card-font/GeneralSans-Regular.otf",
18+
import.meta.url,
19+
),
20+
).then((res) => res.arrayBuffer());
21+
const semiBoldFont = fetch(
22+
new URL(
23+
"../../../../../social-card-font/GeneralSans-Semibold.otf",
24+
import.meta.url,
25+
),
26+
).then((res) => res.arrayBuffer());
27+
2828
const client = createClient();
2929
const { searchParams } = new URL(req.url);
3030

frontend/src/pages/api/[lang]/social-card.tsx

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,10 @@ import type { Language } from "~/locale/languages";
88
import { querySocialCard } from "~/types";
99

1010
export const config = {
11-
runtime: "edge", // ??
11+
runtime: "edge",
1212
unstable_allowDynamic: ["/node_modules/.pnpm/**"],
1313
};
1414

15-
const regularFont = fetch(
16-
new URL("../../../social-card-font/GeneralSans-Regular.otf", import.meta.url),
17-
).then((res) => res.arrayBuffer());
18-
const semiBoldFont = fetch(
19-
new URL(
20-
"../../../social-card-font/GeneralSans-Semibold.otf",
21-
import.meta.url,
22-
),
23-
).then((res) => res.arrayBuffer());
24-
const mainIllustration = fetch(
25-
new URL("../../../../public/images/main-illustration.png", import.meta.url),
26-
).then((res) => res.arrayBuffer());
27-
2815
const getDays = ({ start, end }: { start: string; end: string }) => {
2916
// assuming the same month
3017
const startDate = new Date(start);
@@ -50,6 +37,22 @@ const getYear = ({ end }: { end: string }) => {
5037
};
5138

5239
const handler = async (req: NextRequest) => {
40+
const regularFont = fetch(
41+
new URL(
42+
"../../../social-card-font/GeneralSans-Regular.otf",
43+
import.meta.url,
44+
),
45+
).then((res) => res.arrayBuffer());
46+
const semiBoldFont = fetch(
47+
new URL(
48+
"../../../social-card-font/GeneralSans-Semibold.otf",
49+
import.meta.url,
50+
),
51+
).then((res) => res.arrayBuffer());
52+
const mainIllustration = fetch(
53+
new URL("../../../../public/images/main-illustration.png", import.meta.url),
54+
).then((res) => res.arrayBuffer());
55+
5356
const [regularFontData, semiBoldFontData, mainIllustrationData] =
5457
await Promise.all([regularFont, semiBoldFont, mainIllustration]);
5558
const client = createClient();

0 commit comments

Comments
 (0)