delucis / astro-embed

Low-JavaScript embed components for Astro websites
https://astro-embed.netlify.app
MIT License
166 stars 24 forks source link

Lighthouse: Links are not crawlable with `<YouTube>` #116

Open jrouleau opened 2 months ago

jrouleau commented 2 months ago

Introduced by https://github.com/delucis/astro-embed/pull/102

The play button is now an <a> elements that has its href attribute removed thereby creating the following issues with Lighthouse scores:

Links are not crawlable

Search engines may use href attributes on links to crawl websites. Ensure that the href attribute of anchor elements links to an appropriate destination, so more pages of the site can be discovered. Learn how to make links crawlable

delucis commented 2 months ago

Thanks for the issue! I noticed this as an accessibility problem too: links without href are not focusable, so the play button can’t be reached with the keyboard.

I think this will need fixing in https://github.com/paulirish/lite-youtube-embed which we depend on — maybe by replacing the link with a button when present.

delucis commented 2 months ago

Update: have a fix on a local branch. Will open an upstream PR tomorrow.

delucis commented 2 months ago

Opened a PR here: https://github.com/paulirish/lite-youtube-embed/pull/177

Let’s see if we get a response and if not we can look to revert the progressive enhancement pattern in astro-embed or use my fork of lite-youtube-embed.

jasikpark commented 4 days ago

Potentially off-topic, but it'd be great if the youtube component survived RSS webpage content feed reader sanitization.

Youtube component is totally stripped from article

image

Youtube embed is visible on the raw webpage

image

I think a fallback might be needed?

delucis commented 3 days ago

@jasikpark I think that’s unrelated — see #59

Depends a bit how you’re rendering the RSS feed I suspect.