Using amp script in non-amp page

廉价感情. 提交于 2020-01-11 12:34:30

问题


There are side effects using script amp in standard html5 pages?

My idea is to use amp-iframe to show some related content, also in web pages and not only in amp pages.


回答1:


I have tried some month ago.
My idea was to use the https://cdn.ampproject.org/v0.js to load images async for performance.

Same to use the flying carpet and the Carousel on my regular site. The result was the internal validator brings to much errors, the script breaks, you need the Boilerplate and so on.

So the answer is you can't use the AMP script on a 'normal' HTML site. Or you take the script and modify it for you. But you will lost the on going support of all changes.




回答2:


I haven't seen side effects yet of a nonamp/amp hybrid page. I'm currently using https://cdn.ampproject.org/v0.js for img control (ex: lazy load) on a non amp page.

I'll guess this is not the type of bad coding that Google will result in a rank penalty.

My nonamp page has:

  • Link tag to refer to the real amp page.
  • Google Chrome detects it's nonamp page and suggests the amp page version.
  • No boilerplate.
  • Used nonamp analytics.
  • Did not use thunderbolt or amp in html tag.

Images didn't show up on Blu windows 8 phone. Suspect amp script at fault. Images do show up on Android smartphone.



来源:https://stackoverflow.com/questions/41939367/using-amp-script-in-non-amp-page

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!