juusaw / amp-jekyll

Build Accelerated Mobile Page versions of your Jekyll posts
MIT License
281 stars 59 forks source link

Dummy fix for <picture> elements #16

Closed onnimonni closed 7 years ago

onnimonni commented 7 years ago

I had plenty of responsive images like this one:

<picture>
   <source srcset="mdn-logo-wide.webp" type="image/webp">
   <source srcset="mdn-logo-wide.png" media="(min-width: 600px)">
   <img src="mdn-logo-narrow.png" alt="MDN">
</picture>

This pull request just replaces the <picture> with their inner <img> elements. This could have better optimized srcset handling but at least now it produces valid amp html.

The inner <img> should contain the mostly supported and worst quality image of all options so this is makes it good default for mobile devices.

juusaw commented 7 years ago

Thanks! Looks good, I'll merge to master.

onnimonni commented 7 years ago

Thanks 🍪!