Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

override y-combinator og image (#29774)

Francesco Sansalvadoreced39c1a7e75
diff --git a/apps/www/_events/2024-11-22-supabase-ai-hackathon-at-y-combinator.mdx b/apps/www/_events/2024-11-22-supabase-ai-hackathon-at-y-combinator.mdx
index e4f508dc2eb..29197142af0 100644
--- a/apps/www/_events/2024-11-22-supabase-ai-hackathon-at-y-combinator.mdx
+++ b/apps/www/_events/2024-11-22-supabase-ai-hackathon-at-y-combinator.mdx
@@ -1,9 +1,10 @@
---
-title: 'Supabase AI Hackathon at Y Combinator'
-meta_title: 'Supabase AI Hackathon at Y Combinator'
+title: 'Supabase AI Hackathon at YC'
+meta_title: 'Supabase AI Hackathon at YC'
subtitle: 'Join us at Y Combinator for two days of hacking with Supabase.'
meta_description: 'Join us at Y Combinator for two days of hacking with Supabase.'
type: 'hackathon'
+og_image: '/images/events/hackathons/supabase-ai-hackathon-at-y-combinator/yc-hackathon-og.png'
onDemand: false
main_cta:
{
diff --git a/apps/www/pages/events/[slug].tsx b/apps/www/pages/events/[slug].tsx
index e58f0407d9f..1b860fa78c2 100644
--- a/apps/www/pages/events/[slug].tsx
+++ b/apps/www/pages/events/[slug].tsx
@@ -74,7 +74,7 @@ interface EventData {
end_date?: string
speakers: string
speakers_label?: string
- image?: string
+ og_image?: string
thumb?: string
thumb_light?: string
youtubeHero?: string
@@ -155,9 +155,11 @@ const EventPage = ({ event }: InferGetStaticPropsType<typeof getStaticProps>) =>
event.onDemand ||
(hadEndDate ? Date.parse(event.end_date!) > Date.now() : Date.parse(event.date) > Date.now())
- const ogImageUrl = encodeURI(
- `${process.env.NODE_ENV === 'development' ? 'http://127.0.0.1:54321' : 'https://obuldanrptloktxcffvn.supabase.co'}/functions/v1/og-images?site=events&eventType=${event.type}&title=${event.meta_title ?? event.title}&description=${event.meta_description ?? event.description}&date=${dayjs(event.date).tz(event.timezone).format(`DD MMM YYYY`)}&duration=${event.duration}`
- )
+ const ogImageUrl = event.og_image
+ ? event.og_image
+ : encodeURI(
+ `${process.env.NODE_ENV === 'development' ? 'http://127.0.0.1:54321' : 'https://obuldanrptloktxcffvn.supabase.co'}/functions/v1/og-images?site=events&eventType=${event.type}&title=${event.meta_title ?? event.title}&description=${event.meta_description ?? event.description}&date=${dayjs(event.date).tz(event.timezone).format(`DD MMM YYYY`)}&duration=${event.duration}`
+ )
const meta = {
title: `${event.meta_title ?? event.title} | ${dayjs(event.date)
@@ -205,9 +207,7 @@ const EventPage = ({ event }: InferGetStaticPropsType<typeof getStaticProps>) =>
type: 'article',
images: [
{
- url:
- meta.image ??
- `${origin}${router.basePath}/images/events/${event.image ? event.image : event.thumb}`,
+ url: meta.image,
alt: `${event.title} thumbnail`,
width: 1200,
height: 627,
diff --git a/apps/www/public/images/events/hackathons/supabase-ai-hackathon-at-y-combinator/yc-hackathon-og.png b/apps/www/public/images/events/hackathons/supabase-ai-hackathon-at-y-combinator/yc-hackathon-og.png
new file mode 100644
index 00000000000..c614d92a0e3
Binary files /dev/null and b/apps/www/public/images/events/hackathons/supabase-ai-hackathon-at-y-combinator/yc-hackathon-og.png differ