Socket
Book a DemoInstallSign in
Socket

assemble-permalinks

Package Overview
Dependencies
Maintainers
2
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

assemble-permalinks

Assemble plugin for easily creating permalinks (Assemble ^0.6.0)

latest
Source
npmnpm
Version
0.6.1
Version published
Maintainers
2
Created
Source

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

  • 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

CommitsContributor
26doowb
14jonschlinkert

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.

Keywords

assemble

FAQs

Package last updated on 17 Jun 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts