1

How can we implement AMP(Accellerated Mobile Pages) in Meteor JS 1.1.0.3 and Meteor 1.3?

In meteor 1.1.0.3 there is no <html> tag. If I add <html ⚡> it is giving error. And in meteor 1.1.0.3 the tags and builting automatically. So it gives amp validation error The tag 'script' is disallowed except in specific forms. Any help is appreciated.

Jonathan Kempf
  • 699
  • 1
  • 13
  • 27
Vidya S Masani
  • 398
  • 2
  • 13
  • I don't think you can implement AMP in a full javascript framework like Meteor. Meteor sends over all of its `js`at once, which I believe will already violates key aspects of AMP pages. See [this similar question](http://stackoverflow.com/questions/35582471/how-can-i-implement-amp-in-angular-ionic-website). – Conor Strejcek May 24 '16 at 19:48
  • Thank you for you response. – Vidya S Masani May 25 '16 at 04:36
  • But if we are using AMP(put forwarded by Google) it will be an advantage for SEO. So can you please suggest which will be better using 'amp js' which supports AMP or Meteor JS? – Vidya S Masani May 25 '16 at 04:49

1 Answers1

6

Short answer:

You can't


Longer answer:

You can't and you really wouldn't want to, since this is not what AMP pages are for. AMP pages are created to serve content quickly: static content like news articles, blog posts, and stories. Meteor is usually used to build Javascript apps that are highly interactive and run universal JS. AMP is not a javascript framework, it is a validation & performance framework to ensure performance best practices are being followed for static content.

There are strict rules for what is allowed on a AMP page, and Javascript frameworks (which bloat RAIL) are definitely not on that whitelist.

Jonathan Kempf
  • 699
  • 1
  • 13
  • 27
  • 1
    I have to disagree. I do not believe this is completely impossible, as I'm experimenting with an approach currently. One approach would be to render the full html server side "SSR" with amp compliant html. You could serve a query param that would be used or passed to FlowRouter, and FlowRouter would send back an amp variant of the content you are serving. Keep in mind the key idea to getting close to something like this would be leveraging server side rendering of your content. – Ryan Watts Aug 10 '16 at 23:10
  • @Ryan Watts, where you able to figure it out? - I am trying to add AMP tags to my site https://coolmoviebites.com – Abhay Oct 18 '16 at 03:44