In this chapter, we're going to build on the boilerplate code from the previous chapter. We'll see how to build a simple news article page, while highlighting similarities and differences between AMP-HTML and regular HTML.
We'll also learn about AMP validation. Validation is a key step in the AMP development workflow. We'll see what happens when you use HTML tags that aren't permitted and we'll learn how to develop and debug AMP pages, making use of the AMP validator and browser developer console as indispensable tools. What AMP takes with one hand in restricting HTML tags, it gives with the other, in providing custom elements. We'll see how custom elements can be used in your AMP pages to add functionality otherwise unavailable.
The AMP project has a lightning bolt as its logo for good reason: AMP pages are lightning fast. In this book you'll learn how to ride the lightning with AMP.
Topics covered in Chapter 2 include the following:
- How to develop pages in AMP, and how to convert a non-AMP HTML page to AMP-HTML
- Restricted HTML tags in AMP
- How to validate and debug your AMP pages
- How to use amp-img
- How to measure web page performance
Buy "AMP: Building Accelerated Mobile Pages" on Amazon US, Amazon UK
View Examples
- Original non-AMP page: news.html
- Page converted to AMP: news.amp.html
Download code
Download all code for this chapter: ch2.zip