metalsmith-imagecover
v1.0.0
Published
A metalsmith plugin to assign each page with an image cover.
Downloads
1
Readme
metalsmith-imagecover
A Metalsmith plugin to assign each page with an image cover.
Installation
$ npm install metalsmith-imagecover
CLI Usage
Install via npm and then add the metalsmith-imagecover
key to your metalsmith.json
plugin, like so:
{
"plugins": {
"metalsmith-imagecover": true
}
}
Javascript Usage
var excerpts = require('metalsmith-excerpts');
metalsmith.use(excerpts());
Options
{
"property": 'cover',
"attributes": ['src', 'alt', 'title']
}
How to use in your template
Place in your template something like:
{% if post.cover %}
<img src="{{post.cover.src}}" alt="{{post.cover.alt}}" title="{{post.cover.src}}"/>
{% endif %}
License
MIT