AMP HTML是否允许使用非官方的自定义元素
AMP页面可以使用非官方的自定义组件吗?
Will an AMP page work with an unofficial custom component?
我可以想像得到一个官方网站最适合推广使用,但是对于一个想要在某个自定义组件中进行编程的网站来说,它是否需要将其组件批准为官方网站,或者可以制作一个并包含在自己的组件中代码?
I can imagine getting an official one is best for spreading usage but for just 1 site which wants to program in some custom component does it need to get its component approved as official or it can just make one and include it in its own code?
https://github.com/ampproject/amphtml/blob/master/spec/amp-html-components.md
否.一个非官方的自定义组件将不得不破坏符合AMP的内容可能没有任何JavaScript".约束.
No. An unofficial custom component would have to break the "AMP-conforming content may not have any JavaScript." constraint.
我建议按照组件内置的特定于服务的JavaScript"部分中所述的方法进行操作:
I'd suggest either following the approach described in the "Service-specific JavaScript built-in to a component" section: https://github.com/ampproject/amphtml/blob/master/spec/amp-html-components.md or working with the project to get your desired component included.