Skip to content

minimal fix: normalize vimeo urls - #518

Open
rugeli wants to merge 1 commit into
mainfrom
feature/viemo-url-normalization
Open

rugeli wants to merge 1 commit into
mainfrom
feature/viemo-url-normalization

Conversation

@rugeli

@rugeli rugeli commented Sep 16, 2026

Copy link
Copy Markdown
Collaborator

Problem

What is the problem this work solves, including
Help Sara to get the vimeo videos to render correctly on the site.

Solution

What I/we did to solve this problem

add a helper pulls the numeric video ids out of vimeo.com urls and write the id tohttps://player.vimeo.com/video/<id>

Screenshot 2026-09-16 at 7 26 23 PM

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Steps to Verify:

  • check the videos that recently merged to main, see if they render correctly on the preview site
  • preview
  • admin preview

@netlify

netlify Bot commented Sep 16, 2026

Copy link
Copy Markdown

Deploy Preview for cell-catalog ready!

Name Link
🔨 Latest commit 064501d
🔍 Latest deploy log https://app.netlify.com/projects/cell-catalog/deploys/6aab03d5bdfb5a000807287e
😎 Deploy Preview https://deploy-preview-518--cell-catalog.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Comment thread src/utils/mediaUtils.ts
Comment on lines +40 to 52
// pulls the numeric video id out of any vimeo.com url
export const getVimeoVideoId = (url: string): string | null => {
const match = url.match(/vimeo\.com\/(?:.*\/)?(\d+)(?:[/?#]|$)/);
return match ? match[1] : null;
};

// rewritten vimeo url to the embeddable player form
export const getVideos = (rawMedia?: MediaFrontmatter): RawVideoData[] => {
return rawMedia?.videos || [];
return (rawMedia?.videos ?? []).map((v) => {
const id = getVimeoVideoId(v.video);
return id ? { ...v, video: `https://player.vimeo.com/video/${id}` } : v;
});
};

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

these are the only new lines, the rests are formatting

@rugeli
rugeli requested review from interim17 and meganrm September 17, 2026 16:23
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