我可以在不是有效AMP页面的页面上使用AMP(加速移动页面)组件/标签吗? [英] Can I use AMP (Accelerated Mobile Pages) components/tags on a page that is not a valid AMP page?
问题描述
我可以在不是有效AMP页面的页面上使用AMP(加速移动页面)组件/标签吗?
Can I use AMP (Accelerated Mobile Pages) components/tags on a page that is not a valid AMP page?
我对此有优点还是缺点?这是一个好习惯吗?
Will I have advantages or disadvantages with this? Is it a good practice or not?
我想通过AMP组件/标签加载元素的方式使用它们(例如amp-carousel和amp-img),但是由于我具有自定义javascript代码的AMP页面,因此我无法将我的网站完全转换为AMP不允许我使用(不适用于amp-iframe).
I would like to use the AMP components/tags by the way it load the elements (like amp-carousel and amp-img), but I can not fully convert my website to AMP since I have custom javascript codes that AMP page dont allow that I use (that do not apply using amp-iframe).
保留标准元素和其他库对我来说更好吗,或者即使该页面不是有效的AMP页面,使用AMP组件对我还是有效的?
Is it better for me to keep standard elements and other libraries, or is it valid for me to use AMP components even though the page is not a valid AMP page?
谢谢!
推荐答案
AMP
的主要优点是缩短了加载时间.您可以通过删除Javascript,将img
替换为amp-img
等来实现.
AMP
提供了大量自己的JS实现,例如,Twitter,Google Analytics(分析),Pinterest等.参见此处: https://www.ampproject.org/docs/reference/components
The major advantage of AMP
is making the loading time better. You can achieve that by getting rid of Javascript, replacing img
with amp-img
etc.
AMP
offers plenty of it's own JS implementations for example for Twitter, Google Analytics, Pinterest and so on. See here: https://www.ampproject.org/docs/reference/components
在这里您可以找到有关自定义Java脚本受到限制的信息: https://www.ampproject.org/how-it-works/
Here you can find the information, that custom Javascript is restricted: https://www.ampproject.org/how-it-works/
如果您不想从自定义动态内容中退出,则可以使用两个版本的页面并将其链接到<head>
中.
If you don't want to resign from custom dynamic content, you can have two versions of you page and link them in <head>
.
没有完全符合AMP的页面的缺点??我认为Google可能不会为使用AMP验证规则不完全有效的AMP页面编制索引.
Disadvantages of having not fully AMP conform page? I think that Google might not index AMP pages that are not fully valid with AMP validation rules.
这篇关于我可以在不是有效AMP页面的页面上使用AMP(加速移动页面)组件/标签吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!