Basic AMP Template Example

AMP templates place some restrictions on the HTML and the content you can display to make it valid.  With that mark-up in mind, a very basic Episerver implementation might look like this:

Calling Your AMP Template

In your controller, you could trigger the AMP view via the query string.

Validating Your AMP Mark-up

Creating valid AMP HTML can take a bit of time and practice. To make sure that your HTML is valid, you can use the AMP validator.

To validate your HTML, render your page within a browser, copy the HTML from it and then paste it into the validator and click the 'validate' button.  If the HTML passes you'll see a green tick, if not, you'll get a list of all the violations.

If you are wondering what these violations might look like, you'll typically see things like image tags not having width and height set, style attributes on images etc..