Conversation
|
I really love this (despite hating AMP) but it would be awesome if there could be a more abstract version that is able to convert the blocks into multiple formats. A bit like content representations but for the editor. What do you think? |
|
I totally agree. It would be nice to have a more coherent way to expand this to other formats. I'm happy to to revise this to a more generic pattern (unless you had something in mind), but I suspect the ultimate product will hinge on "Block Plugins" #199. Editor would provide the foundation for "content representations," but a plugin would provide the actual AMP-specific content. Or, did you also want AMP support to be built-in to Editor? For a Block content representation system, I think it should be flexible enough that:
|
|
I would LOVE this to be accepted, as much as AMP is not loved my all, its pretty much required for my type of site, hurts not having it amp compatible. |
Describe the PR
This pull request introduces AMP HTML support. Tags such as
<img>and<iframe>are strictly forbidden in AMP, so this adds compatible versions of the image and video blocks. The HTML from other blocks should already be AMP compatible.Usage
Extending
If a block requires an AMP snippet variant, append an
.ampextension to the snippet name. For example:Videos
If you intend on using YouTube or Vimeo videos, you'll need to include one/both of the following in your AMP's page
<head>.This can automatically provided by using the
ampCustomElementScriptTags()method on a Blocks collection.Kirbytext
Simple usage of a Kirbytext block will likely generate AMP-valid code, but some Kirbytags (such as
(image: ),(video: ), and some custom tags) will generate incompatible AMP code. You should avoid using these kind of Kirbytags if you want valid AMP code.Ready?
composer fix