How to use AMP in jekyll?

I have gone throught the AMP start guide, but they have not mentioned anything about Jekyll.

Is there any kind of special modification, we need to do for the jekyll website to use AMP in it?

There are several AMP themes, which you might be able to use or adapt:✓&q=jekyll+amp+theme

1 Like

Yes. You need to include the AMP scripts in your layout. And do some markup changes for things like AMP images.

There are several Jekyll AMP themes out there to give you an idea of what needs to be done. There is also a Jekyll plugin which does some of the AMP markup generation for you.

1 Like

I was going through the AMP documentation and they were saying to change all the <img> to <amp-img>.

But how to do that, because in the markdown files. We add this only


and the output is

<img src="link" alt="Text">

so how to change <img> to <amp-img>.

The amp-jekyll plugin mentioned by @mmistakes has a filter that converts img to amp-img.

Can I use it with gh-pages?

Github Pages only supports a few plugins. the full list doesn’t mention AMP, but you might want to double-check.

Sorry to write in an old thread, but the way I did it with my site build it AMP-first with Jekyll.

1 Like