TheJoin's Blog


Jekyll - Add AMP Pages to your blog


category: jekyll | tags: jekyll

We already know the power of the AMP pages but… what if we’ll use in our blog? That would be incredible!

Let’s to this!

What we need?

And, of course… a blog with at least one post.

Install & Setup the plugin

Install the plugin via the Gemfile

gem install amp-jekyll

Then add to your _config.yml the plugin:

plugins:
  - amp-jekyll

NOTE: Older Jekyll versions (below 3.6.0) use the key gems instead of plugins. When building a site with such version, use the old key.

Then we need to specify the AMP Folder in the _config.yml, where all the pages will be stored:

ampdir: YOURDIR

Setting up the amphtml meta

Put this meta inside your head to link the AMP page to your post page (tell to Google: “Hey, I’ve got AMP!”):

  <link rel="amphtml" href="https://blog.thejoin.it/YOURDIR/how-add-amp-pages-jekyll.html">

Setting up some style

Now it’s your turn: style your AMP page! I can suggest you to use this awesome theme: https://github.com/ageitgey/amplify