How can a page tell browsers that an AMP HTML version exists?

送分小仙女□ 提交于 2019-12-01 17:01:09

问题


I understand I will have two pages, the AMP one and the regular one. The AMP one has a canonical link to the regular one, but how does the regular one specify that there is a AMP version available?


回答1:


The AMP document discovery documentation specifies that you need to add this tag in the <head>:

<link rel="amphtml" href="...">

As an example, if you take a look at a page from a publisher that already supports AMP, such as http://www.bbc.co.uk/news/world-europe-34471849, you can see this tag in the <head>:

<link rel="amphtml" href="http://www.bbc.co.uk/news/amp/34471849">


来源:https://stackoverflow.com/questions/33011297/how-can-a-page-tell-browsers-that-an-amp-html-version-exists

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