Assemble plugin for easily creating permalinks (Assemble ^0.6.0)
npm install assemble-permalinks> Assemble plugin for easily creating permalinks (Assemble ^0.6.0)
Install with npm:
``sh`
$ npm install --save assemble-permalinks
Install with yarn:
`sh`
$ yarn add assemble-permalinks
HEADS UPS
* 0.5.0 has a breaking change. It will no longer immediately run the permalink when used on a view directly.
`js
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
`js
// 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
`js
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!');
});
`
* assemble: Get the rocks out of your socks! Assemble makes you fast at creating web projects… more | homepage
* templates: System for creating and managing template collections, and rendering templates with any node.js template engine… more | homepage
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:
`sh`
$ 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:
`sh``
$ npm install && npm test
Jon Schlinkert
* github/jonschlinkert
* twitter/jonschlinkert
Copyright © 2017, Jon Schlinkert.
Released under the MIT License.
*
_This file was generated by verb-generate-readme, v0.6.0, on June 17, 2017._