我可以在不是有效 AMP 页面的页面上使用 AMP(加速移动页面)组件/标签吗? [英] Can I use AMP (Accelerated Mobile Pages) components/tags on a page that is not a valid AMP page?

查看:37
本文介绍了我可以在不是有效 AMP 页面的页面上使用 AMP(加速移动页面)组件/标签吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以在不是有效 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),但我无法将我的网站完全转换为 AMP,因为我有 AMP 页面的自定义 JavaScript 代码不允许我使用(不适用于 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

您可以在此处找到有关自定义 Javascript 受到限制的信息: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/

如果您不想退出自定义动态内容,您可以拥有两个版本的页面,并在 中链接它们.

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆