Skip to content

feat: add link preview metadata to seal of reliability page - #240

Merged
cka-y merged 2 commits into
mainfrom
fix/page-title-preview
Sep 16, 2026
Merged

cka-y merged 2 commits into
mainfrom
fix/page-title-preview

Conversation

@cka-y

@cka-y cka-y commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

Summary:

The /seal-of-reliability sub-route never had a generateMetadata, so it inherited the root layout's site-wide title and description. Sharing a link like https://mobilitydatabase.org/feeds/gtfs/mdb-1120/seal-of-reliability previewed the whole site instead of the feed — no og:* tags at all. The parent feed page and the /map sub-route already had their own metadata; this was the one gap.

Changes:

  • Feed.functions.tsx — adds generateSealPageTitle and generateSealDescriptionMetaTag, mirroring the existing map-page helpers.
  • lib/generate-feed-metadata.ts — adds generateSealFeedMetadata (title, description, OpenGraph, Twitter card, canonical URL).
  • static/seal-of-reliability/page.tsx and authed/seal-of-reliability/page.tsx — wire it in. Both reuse the cached fetcher the page body already calls (fetchGuestFeedData / fetchCompleteFeedData), so this adds no extra API request.
  • messages/{en,fr}.json — adds feeds.sealPageDescription.

Expected behavior:

Before (live site):

<meta name="description" content="Access GTFS, GTFS Realtime, GBFS transit data with over 6,000 feeds from 99+ countries..."/>
(no og:* or twitter:* tags)

After:

<meta name="description" content="See how the Lasta a.d. Beograd GTFS Schedule feed performs against each Seal of Reliability criterion."/>
<meta property="og:title" content="Lasta a.d. Beograd GTFS Schedule Feed Seal of Reliability - Mobility Database"/>
<meta property="og:description" content="See how the Lasta a.d. Beograd GTFS Schedule feed performs against each Seal of Reliability criterion."/>
<meta property="og:url" content="https://mobilitydatabase.org/feeds/gtfs/mdb-1120/seal-of-reliability"/>
<meta property="og:site_name" content="Mobility Database"/>
<meta property="og:type" content="website"/>
<meta name="twitter:card" content="summary"/>
<meta name="twitter:title" content="Lasta a.d. Beograd GTFS Schedule Feed Seal of Reliability - Mobility Database"/>
<meta name="twitter:description" content="See how the Lasta a.d. Beograd GTFS Schedule feed performs against each Seal of Reliability criterion."/>

Note: previews remain text-only. There is no og:image anywhere on the site, so link cards show a title and description but no image. A generated card image (opengraph-image.tsx via ImageResponse) would be a good follow-up, but is out of scope here.

Testing tips:

  1. yarn start:dev, then check the tags on a GTFS feed's seal page:

    curl -sL "http://localhost:3000/feeds/gtfs/mdb-1120/seal-of-reliability" | grep -oE '<meta[^>]*(og:|twitter:|name="description")[^>]*>'
    

    Expect the provider name in og:title / og:description, not the generic site copy.

  2. Worth checking both proxy paths, since the fix touches both: signed out hits static/, signed in hits authed/. Both should produce identical tags.

  3. /fr/feeds/gtfs/mdb-1120/seal-of-reliability should pick up the French feeds.sealPageDescription.

  4. Confirm the parent feed page and /map are unchanged — those already had metadata and this PR shouldn't touch them.

Please make sure these boxes are checked before submitting your pull request - thanks!

  • Run the unit tests with yarn test to make sure you didn't break anything
  • Add or update any needed documentation to the repo — no doc changes needed; this follows the existing metadata pattern
  • Format the title like "feat: [new feature short description]". Title must follow the Conventional Commit Specification(https://www.conventionalcommits.org/en/v1.0.0/).
  • Linked all relevant issues — no tracking issue; reported directly
  • Include screenshot(s) showing how this pull request works and fixes the issue(s) — meta tag output included above in place of screenshots

@welcome

welcome Bot commented Sep 16, 2026

Copy link
Copy Markdown

Thanks for opening this pull request! You're awesome. We use semantic commit messages to streamline the release process. Before your pull request can be merged, you should update your pull request title to start with a semantic prefix. Examples of titles with semantic prefixes:

  • fix: Bug with ssl network connections + Java module permissions.
  • feat: Initial support for multiple @PrimaryKey annotations.
  • docs: update RELEASE.md with new process
    To get this PR to the finish line, please do the following:
  • Include tests when adding/changing behavior
  • Include screenshots

@vercel

vercel Bot commented Sep 16, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
mobilitydatabase-web Ready Ready Preview Sep 16, 2026 5:39pm UTC

Request Review

@cka-y
cka-y marked this pull request as ready for review September 16, 2026 16:54
@cka-y cka-y self-assigned this Sep 16, 2026
@github-actions

Copy link
Copy Markdown

*Lighthouse ran on https://mobilitydatabase-666edxiy1-mobility-data.vercel.app/ * (Desktop)
⚡️ HTML Report Lighthouse report for the changes in this PR:

Performance Accessibility Best Practices SEO
🟢 100 🟢 94 🟢 96 🟢 100

*Lighthouse ran on https://mobilitydatabase-666edxiy1-mobility-data.vercel.app/feeds * (Desktop)
⚡️ HTML Report Lighthouse report for the changes in this PR:

Performance Accessibility Best Practices SEO
🟠 89 🟠 87 🟢 96 🟢 100

*Lighthouse ran on https://mobilitydatabase-666edxiy1-mobility-data.vercel.app/feeds/gtfs/mdb-2126 * (Desktop)
⚡️ HTML Report Lighthouse report for the changes in this PR:

Performance Accessibility Best Practices SEO
🔴 48 🟢 94 🟢 96 🟢 100

*Lighthouse ran on https://mobilitydatabase-666edxiy1-mobility-data.vercel.app/feeds/gtfs_rt/mdb-2585 * (Desktop)
⚡️ HTML Report Lighthouse report for the changes in this PR:

Performance Accessibility Best Practices SEO
🟢 97 🟠 84 🟢 96 🟢 100

*Lighthouse ran on https://mobilitydatabase-666edxiy1-mobility-data.vercel.app/feeds/gbfs/gbfs-flamingo_porirua * (Desktop)
⚡️ HTML Report Lighthouse report for the changes in this PR:

Performance Accessibility Best Practices SEO
🟢 98 🟢 94 🟢 96 🟢 100

@Alessandro100 Alessandro100 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cka-y
cka-y merged commit 63548aa into main Sep 16, 2026
4 checks passed
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.

2 participants