Skip to content

Commit c39406c

Browse files
authored
Fix social cards (#4209)
1 parent 04fb7e2 commit c39406c

8 files changed

Lines changed: 13 additions & 11 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,7 @@ jobs:
321321
platforms: linux/arm64
322322
build-args: |
323323
API_URL_SERVER=https://${{ fromJSON('["pastaporto-", ""]')[github.ref == 'refs/heads/main'] }}admin.pycon.it
324+
NEXT_PUBLIC_SITE_URL=${{ fromJSON('["pastaporto-frontend.", ""]')[github.ref == 'refs/heads/main'] }}pycon.it
324325
CMS_ADMIN_HOST=${{ fromJSON('["pastaporto-", ""]')[github.ref == 'refs/heads/main'] }}admin.pycon.it
325326
CMS_HOSTNAME=${{ steps.vars.outputs.cms_hostname }}
326327
CONFERENCE_CODE=${{ steps.vars.outputs.conference_code }}

.vercelignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
**/social-card.tsx

frontend/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ ARG API_URL_SERVER
1616
ARG CMS_HOSTNAME
1717
ARG CONFERENCE_CODE
1818
ARG CMS_ADMIN_HOST
19+
ARG NEXT_PUBLIC_SITE_URL
1920
ARG GIT_HASH
2021

2122
WORKDIR /app

frontend/next.config.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ const {
77
CONFERENCE_CODE,
88
API_URL,
99
API_TOKEN,
10-
NEXT_PUBLIC_SOCIAL_CARD_SERVICE,
1110
NEXT_PUBLIC_VERCEL_URL,
1211
API_URL_SERVER,
1312
CMS_HOSTNAME,
1413
CMS_ADMIN_HOST = "admin.pycon.it",
14+
NEXT_PUBLIC_SITE_URL,
1515
} = process.env;
1616

1717
module.exports = withSentryConfig({
@@ -113,12 +113,11 @@ module.exports = withSentryConfig({
113113
API_URL: API_URL,
114114
conferenceCode: CONFERENCE_CODE || "pycon-demo",
115115
cmsHostname: CMS_HOSTNAME,
116-
NEXT_PUBLIC_SOCIAL_CARD_SERVICE:
117-
NEXT_PUBLIC_SOCIAL_CARD_SERVICE ||
118-
"https://socialcards.python.it/api/card",
119-
NEXT_PUBLIC_SITE_URL: NEXT_PUBLIC_VERCEL_URL
120-
? `https://${NEXT_PUBLIC_VERCEL_URL}/`
121-
: "http://localhost:3000/",
116+
NEXT_PUBLIC_SITE_URL: NEXT_PUBLIC_SITE_URL
117+
? `https://${NEXT_PUBLIC_SITE_URL}/`
118+
: NEXT_PUBLIC_VERCEL_URL
119+
? `https://${NEXT_PUBLIC_VERCEL_URL}/`
120+
: "http://localhost:3000/",
122121
},
123122
images: {
124123
domains: [

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { TitleSubtitleCard } from "~/components/social-card-images/title-subtitl
77
import { queryTalk } from "~/types";
88

99
export const config = {
10-
runtime: process.env.VERCEL_ENV === "preview" ? undefined : "edge",
10+
runtime: "edge",
1111
unstable_allowDynamic: ["/node_modules/.pnpm/**"],
1212
};
1313

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { TitleSubtitleCard } from "~/components/social-card-images/title-subtitl
77
import { queryTalk } from "~/types";
88

99
export const config = {
10-
runtime: process.env.VERCEL_ENV === "preview" ? undefined : "edge",
10+
runtime: "edge",
1111
unstable_allowDynamic: ["/node_modules/.pnpm/**"],
1212
};
1313

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { TitleSubtitleCard } from "~/components/social-card-images/title-subtitl
77
import { queryNewsArticle } from "~/types";
88

99
export const config = {
10-
runtime: process.env.VERCEL_ENV === "preview" ? undefined : "edge",
10+
runtime: "edge",
1111
unstable_allowDynamic: ["/node_modules/.pnpm/**"],
1212
};
1313

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import type { Language } from "~/locale/languages";
88
import { querySocialCard } from "~/types";
99

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

0 commit comments

Comments
 (0)