metalsmith-imagecover

1.0.0 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i metalsmith-imagecover

Weekly Downloads

1

Version

1.0.0

License

MIT

Last publish

Collaborators

  • frnd