godaddy-wordpress / godaddy-wordpress/coblocks
AMP compatibility
- Dominant language
- JavaScript
- Stars
- 794
- Forks
- 142
- PR merge metrics
- No merged PRs in 30d
Description
I was very pleased when testing out all the blocks that they almost all worked just fine when viewed in the [AMP plugin](https://wordpress.org/plugins/amp/)'s Standard or Transitional modes. Thus, making CoBlocks AMP-compatible appears to be pretty straightforward for the various blocks:
* Accordion: Perhaps consider using `amp-accordion`, though the use of `details` works just fine as it stands.
* Gist: Register an oEmbed handler for Gists like Jetpack has done. See https://github.com/godaddy/coblocks/issues/175#issuecomment-519384801
* SVG: Various blocks are writing out SVG with an attribute `fillrule`. This is not valid SVG and so it the AMP validator is not recognizing it (and thus stripping it). It should rather be [`fill-rule`](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/fill-rule), AFAIK. Simply doing a search/replace for `s/fillrule/fill-rule/i`. I'm afraid this could cause block validation problems, but if not, this is an easy fix.
* Share: These could potentially use `amp-social-share` component.
* Carousel Gallery: Make use of `amp-carousel` on the front-end rather than using flickity.
* Masonry Gallery: Not yet AMP-compatible. See https://github.com/ampproject/amphtml/issues/19866.
Contributor guide
Assessment
This issue has not been assessed yet.