Skip to content

feat(events): show real link previews for shared event links - #536

Merged
mohanadft merged 1 commit into
mainfrom
feat/events-link-preview
Aug 31, 2026
Merged

feat(events): show real link previews for shared event links#536
mohanadft merged 1 commit into
mainfrom
feat/events-link-preview

Conversation

@mohanadft

Copy link
Copy Markdown
Collaborator

Summary

  • A shared event link (?event=<id>, from the modal's "copy link" button) previewed as the generic "Events" page in Slack/iMessage/social — link previews only ever see server-rendered <meta> tags, and the event modal itself only opens client-side after hydration.
  • Adds eventMetaTags(event) (src/utils/eventMeta.ts) to build a title/description/image from an EventItem (reusing displayTitle and getDescriptionExcerpt), falling back to the site's default OG image when no flyer/thumbnail resolves.
  • events-new.astro already fetches events server-side, so it just looks up the linked event and overrides the HomeLayout title/description/image props when found.
  • events.astro intentionally skips server-side fetching otherwise (client:only page), so it only does the extra fetchEvents() call when ?event= is present — normal page loads are unaffected.

Test plan

  • Copy a link to an event with a flyer set, paste it into something that unfurls links (e.g. Slack), confirm the preview shows the event's title/description/flyer image.
  • Repeat for an event with no flyer (YouTube thumbnail or default image) and confirm a sensible fallback shows.
  • Confirm /events and /events-new without ?event= still show the generic Events page preview, unchanged.
  • Confirm a stale/unknown ?event= id falls back to the generic preview without erroring.
  • pnpm check passes.

A pasted ?event=<id> link previewed with the generic Events page
title/description/image, not the actual event, since previews are
built from server-rendered <meta> tags and the event modal only opens
client-side.

Adds eventMetaTags() to build a title/description/image from an
EventItem, and wires it into both events-new.astro (already fetching
events server-side) and events.astro (adds a server-side fetch, but
only when ?event= is present, to keep the page's normal client-only
load path unchanged).
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying website with  Cloudflare Pages  Cloudflare Pages

Latest commit: fb1d3a6
Status: ✅  Deploy successful!
Preview URL: https://76a74405.website-aun.pages.dev
Branch Preview URL: https://feat-events-link-preview.website-aun.pages.dev

View logs

@mohanadft
mohanadft merged commit f6f539d into main Aug 31, 2026
5 checks passed
@mohanadft
mohanadft deleted the feat/events-link-preview branch August 31, 2026 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant