delucis/astro-embed

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

jrouleau opened this issue · 9 comments

Introduced by #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

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.

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

Opened a PR here: paulirish/lite-youtube-embed#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.

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?

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

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