Skip to content

Commit

Permalink
FIx use of OG image for event preview (#41)
Browse files Browse the repository at this point in the history
Changes to our metadata tags and `<PageHead>` elements caused us to lose
the Open Graph preview image for event pages. This fixes that issue.
  • Loading branch information
mplewis authored Nov 18, 2024
1 parent 7bbbde3 commit dec77fc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
- [ ] Make Sentry DSN optional
- [ ] Consensually gather user emails for mailing list
- [ ] Add pretty error messages for 404s (e.g. clicked an expired/tidied link)
- [ ] Redirect old slugs on slug change
- [x] Hold RSVP locally with cookie
- [x] **Scheduler engine**
- [x] Send reminders
Expand Down
7 changes: 6 additions & 1 deletion web/src/components/ShowEvent/ShowEvent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
prettyStartWithUntil,
} from 'src/apiLib/convert/date'
import { markdownToHTML } from 'src/apiLib/markdown'
import { eventPreviewImagePublicURL } from 'src/apiLib/url'
import { SITE_HOST } from 'src/app.config'
import { responseTokenAtom } from 'src/data/atoms'
import { scrollTo } from 'src/logic/scroll'
Expand Down Expand Up @@ -115,7 +116,11 @@ const ShowEvent = ({ event, preview }: Props) => {
{preview ? (
<Typ x="head">{event.title}</Typ>
) : (
<PageHead title={event.title} desc={event.description.slice(0, 80)} />
<PageHead
title={event.title}
desc={event.description.slice(0, 80)}
ogImage={eventPreviewImagePublicURL(event.slug)}
/>
)}
<Typ x="p">
<strong>From:</strong> {prettyStartWithUntil(start, tz)}
Expand Down

0 comments on commit dec77fc

Please sign in to comment.