wp-pwa / saturn-app-theme-worona

Saturn theme for worona apps
1 stars 0 forks source link

Create custom AMP components and start using them in the post content #42

Closed luisherranz closed 7 years ago

luisherranz commented 7 years ago

Some AMP components need to load a js library.

We could create a generic component which should add the library only if it has not been added yet. For example:

<AmpComponent tag="amp-youtube" src="https://cdn.ampproject.org/v0/amp-youtube-0.1.js" ...props />

// output:
<amp-youtube ...props/>
// only the first time:
<script async custom-element="amp-youtube" src="https://cdn.ampproject.org/v0/amp-youtube-0.1.js"></script> 
DAreRodz commented 7 years ago

We have stopped working on this issue. It looks like "lazy loading" does not work for amp components inside elements with css attributes overflow: auto or overflow: scroll, and we need to use that attributes.

Latest changes in this branch: https://github.com/worona/saturn-app-theme-worona/tree/amp-integration