What is AMP ?
Why should I use AMP (as a user) ?
Why should I use AMP (as a dev) ?
1 - Mobile traffic data from Zenith Media
2 - Search engine data from statcounter
Counter-intuitive: Check your performance scores (e.g. lighthouse) and user engagement mediums (mostly mobile), you may not need AMP π
How do I AMP ? πΈπ€
Actual Path | AMP Path | |
---|---|---|
Hybrid | /users | /users?amp=1 |
Amp-only | /users | /amp/users |
<!doctype html>
<html amp lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1">
<title><%= title %></title>
<link rel="canonical" href="<%= linkToNonAmpVersion %>">
<style amp-boilerplate>body{-webkit-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-moz-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-ms-animation:-amp-start 8s steps(1,end) 0s 1 normal both;animation:-amp-start 8s steps(1,end) 0s 1 normal both}@-webkit-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-moz-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-ms-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-o-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}</style><noscript><style amp-boilerplate>body{-webkit-animation:none;-moz-animation:none;-ms-animation:none;animation:none}</style></noscript>
<script async src="https://cdn.ampproject.org/v0.js"></script>
</head>
<body>
<%= yield %>
</body>
</html>
Script tags with type as application/javascript and link tags with rel value as stylesheet are not allowed in AMP.
Use inline style tags ( max 50kB )
https://validator.ampproject.org/
Tips
Use Google's search console
Don't invest in Bing (for now) :(
Unless you can get featured in the AMP Carousel, in the United States ...
"Build" against silent failures
Use "amphtml-validator" or the likes to test against a
link to some page (e.g. test server) or a static HTML file
Official documentation: amp.dev
My writeup on AMP: bit.ly/amp-medium
Linkedin / Github : bit.ly/weiyuan