coblocks
coblocks copied to clipboard
AMP compatibility
I was very pleased when testing out all the blocks that they almost all worked just fine when viewed in the AMP plugin'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 ofdetailsworks 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 befill-rule, AFAIK. Simply doing a search/replace fors/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-sharecomponent. - Carousel Gallery: Make use of
amp-carouselon the front-end rather than using flickity. - Masonry Gallery: Not yet AMP-compatible. See https://github.com/ampproject/amphtml/issues/19866.
Issue came up in #2562906-zen