1.0.0 • Published 8 years ago

metalsmith-imagecover v1.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

Build Status

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