metalsmith-relativity

0.1.1 • Public • Published

metalsmith-relativity

Metalsmith plugin that adds relativity path metadata to files. This is a path prefix to move from file directory back to the source directory for metalsmith.

Installation

$ npm install metalsmith-relativity --save-dev

Javascript Usage

Pass with options to Metalsmith#use:

var relativity = require('metalsmith-relativity');
 
metalsmith.use(relativity({
  depth: 0 // !default
}));

Example

page/news/a-super-event.html

---
relativity: ../../
---

<img src="{{relativity}}assets/imgs/photo.jpg" />

Options

There are a couple options available to make relativity more useful.

depth

Defines initial depth of relative directory, only positive integers are valid.

License

MIT

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.1.1
    1
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.1.1
    1
  • 0.1.0
    0

Package Sidebar

Install

npm i metalsmith-relativity

Weekly Downloads

1

Version

0.1.1

License

MIT

Last publish

Collaborators

  • krambuhl