Skip to content

Permalinks plugin for assemble (0.6+)

License

Notifications You must be signed in to change notification settings

assemble/assemble-permalinks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Jun 17, 2017
d2b6333 · Jun 17, 2017

History

47 Commits
Jun 17, 2017
Jun 17, 2017
Jun 17, 2017
Sep 19, 2015
Jun 17, 2017
Jun 17, 2017
Jul 12, 2016
Jun 17, 2017
Jun 17, 2017
Jan 15, 2016
Jun 17, 2017
Jun 17, 2017
Jun 17, 2017
Jun 17, 2017
Jul 11, 2016

Repository files navigation

assemble-permalinks NPM version NPM monthly downloads NPM total downloads Linux Build Status Windows Build Status

Assemble plugin for easily creating permalinks (Assemble ^0.6.0)

Install

Install with npm:

$ npm install --save assemble-permalinks

Install with yarn:

$ 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.

Usage

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!');
});

About

Related projects

  • 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

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.

Contributors

Commits Contributor
26 doowb
14 jonschlinkert

Building docs

(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 tests

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

Author

Jon Schlinkert

License

Copyright © 2017, Jon Schlinkert. Released under the MIT License.


This file was generated by verb-generate-readme, v0.6.0, on June 17, 2017.