Are AMP and non-AMP route possible?


Hi all!

I’m wondering if anyone knows how I might best approach this.

I’m trying to develop a web application that renders both AMP and a non-AMP pages.

The distinction between the two will be handled by injecting the appropriate meta-data using the following: (I’m using ember-cli-head for this)

For non-AMP pages: <link rel="amphtml" href="">

For AMP pages: <link rel="canonical" href="">

~ My problem is I’d like to do this in such a way where I don’t have to duplicate all of my routes.

I guess my question is, can I have all the routes render under and domain/amp/? – Essentially setting two rootURLs.


You can do this:

// route.js
// ...
afterModel(post) {
  this.get('amp').set('canonicalUrl', post.get('url'));
  this.get('amp').set('title', post.get('title'));