Ghost comes with a built-in integration for Google AMP which transforms all of the content on your site into a lightening-fast AMP version ⚡
The open source AMP project is led by Google, and provides a way for publishers to generate lightweight versions of their content for a faster and smoother user experience.
In Ghost, the AMP integration utilises the AMP framework inside a single Handlebars template:
amp.hbs. This template transforms each post on your site into an AMP version which can be accessed by adding
/amp to the end of any URL.
Enabling AMP in Ghost
The AMP integration in Ghost is enabled by default, but if you prefer not to use the feature then you can turn it off in the settings within Ghost Admin. When enabled, all posts on your publication will automatically have an AMP page, with a canonical link to ensure the page is correctly identified by the search engines and no duplicate content issues are found.
Customise the template with your own styles
AMP in Ghost can be styled to suit your brand and theme too! Since the Ghost theme layer is entirely customisable, that means you can also customise the way your AMP pages are rendered.
So if you would like to add some styling, branding or even monetise your AMP pages with advertisements, then you can with a few lines of code in a single Handlebars template.
Read more about customising your AMP pages in Ghost in this handy tutorial.
Validate your template in the console
There is an effective way to validate your AMP pages as you go directly in the console by adding
#development=1 to any AMP URL.
This is a useful way to ensure any customisations you make to your AMP template are valid and your AMP content is rendering correctly.