Assemble plugin for easily creating permalinks (Assemble ^0.6.0)
Install with npm:
$ npm install --save assemble-permalinks
Install with yarn:
$ yarn add assemble-permalinks
HEADS UPS
var permalinks = require('assemble-permalinks');
var assemble = require('assemble');
var app = assemble();
// register the plugin, optionally passing a
// default permalink pattern to use as an argument
// to the plugin
app.use(permalinks());
Example usage
// create a view collection
app.create('pages');
// add a page
app.page('a/b/c.txt', {content: '...'})
.permalink(':name.html');
var page = app.pages.getView('a/b/c.txt');
console.log(page.data.permalink);
//=> 'c.html'
Pipeline plugin
var posts = app.create('posts')
.use(permalink('actual/:name/index.html'));
app.task('site', function() {
return posts.src('*.js')
.pipe(posts.permalink())
.pipe(posts.dest('.'));
});
app.build('site', function(err) {
if (err) throw err;
console.log('done!');
});
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
Commits | Contributor |
---|---|
26 | doowb |
14 | jonschlinkert |
(This project's readme.md is generated by verb, please don't edit the readme directly. Any changes to the readme must be made in the .verb.md readme template.)
To generate the readme, run the following command:
$ npm install -g verbose/verb#dev verb-generate-readme && verb
Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:
$ npm install && npm test
Jon Schlinkert
Copyright © 2017, Jon Schlinkert. Released under the MIT License.
This file was generated by verb-generate-readme, v0.6.0, on June 17, 2017.