Skip to main content
Dublin Library

The Publishing Project

AMP: Hope and Fears (Part 2)

 

## Technical questions There are technical questions that came up when researching AMP and writing this post a few more technical questions ### Converting your content? In talking to people at the Roadshow I now understand that AMP is a testbed to make things better and then bring it back to the wider web community; this is an important goal. I just have issues with the way AMP is doing this. The example below is a basic sample HTML document conforming to the AMP HTML specification. ```html Sample document ``` Some of the requirements and limitations of AMP are not evident. According to [AMP HTML Specification](https://www.ampproject.org/docs/fundamentals/spec) an AMP document must: * start with the doctype < !doctype html> * contain a top-level `` tag (`` is accepted as well) * contain `` and `` tags (They are optional in HTML) * contain a `` tag inside their head that points to the regular HTML version of the AMP HTML document or to itself if no such HTML version exists * contain a `` tag as the first child of their head tag * contain a `` tag inside their head tag. It's also recommended to include initial-scale=1 * contain a `` tag inside their head tag * contain the AMP boilerplate code (`head > style[amp-boilerplate]` and `noscript > style[amp-boilerplate]`) in their head tag If this was all that AMP required for compliance I'd be ok. I've always been a gung-ho fan of proper page structure and including the appropriate elements where they should be. Death to tagsoup markup! I love the idea of having metadata inlined in the document. This makes it easier to enforce (it's part of the AMP HTML spec) but it may make it harder to support in the long run as any change to the doc would require. I may even forgive the extra attribute (other than class) in the HTML element. But this is just the beginning. Amp not only requires a certain structure from your HTML page but it changes some elements for AMP-specific ones and completely disallows others. I'm mostly OK with the tag it forbids as they are mostly legacy elements that have been kept on the specifications for compatibility (don't break the web) reasons. I mean, seriously, frameset and frames? It's 2018 people... we have better ways of doing that! The table below (also from the [AMP HTML Specification](https://www.ampproject.org/docs/fundamentals/spec)) explains the limitations and changes that AMP makes to standard HTML elements. Some of these changes help explain the structure of the example page seen earlier. | Tag | Status in AMP HTML | | --* | --* | | script | Prohibited unless the type is `application/ld+json`. (Other non-executable values may be added as needed.) Exception is the mandatory script tag to load the AMP runtime and the script tags to load extended components. | | noscript | Allowed. Can be used anywhere in the document. If specified, the content inside the `