The Ampimage Plugin is for Grav CMS used together with Google Accelerated Mobile Pages
Grav doesn't support AMP out of the box but it's pretty easy to get started. I've created a minimal theme to get you started: Amp skeleton theme
The plugin replaces html <img>
with AMP-images.
Just add images as usual in grav, and they will be replaced.
![Alternative text](my-example-image.jpg)
To install this plugin, just download the zip version of this repository and unzip it under /your/site/grav/user/plugins
. Then, rename the folder to ampimage
. You can find these files on GitHub or via GetGrav.org.
You should now have all the plugin files under
/your/site/grav/user/plugins/ampimage
NOTE: This plugin is a modular component for Grav which requires Grav and the Error and Problems to operate.
Here is the default configuration and an explanation of available options:
enabled: true
# add <figure> element around <amp-img>
addFigure: true
# move class attribute from image to figure element
moveClassToFigure: true
# sets amp:s layout attribute for all images
defaultLayout: responsive
For available layout modes see AMP HTML Layout System
At the moment manual sizing in .md document doesn't work
![Test image](testimage.jpg?cropResize=300,300)
Ampimg can't determin the size from a non-file image.
I looked a lot at Ole Viks Grav Image Captions Plugin before I started building.
- Grav Package Manager
- Fix resizing issue
- Enable different layout mode for each image