🚀 Launch Week Day 2:Introducing Custom Tabs for Org Alerts.Learn More →
Socket
Book a DemoInstallSign in
Socket

templates-indexer

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

templates-indexer

Templates plugin to add index views to template collections.

latest
Source
npmnpm
Version
0.1.1
Version published
Maintainers
1
Created
Source

templates-indexer NPM version Build Status

Templates plugin to add index views to template collections.

Install with npm

$ npm i templates-indexer --save

Usage

var indexer = require('templates-indexer');

API

indexer

Add addIndices to a templates collection that will add index views to the collection when given an array of pages.

Params

  • options {Object}
  • options.createView {Function}: Function to create a view object for the index view being added.
  • options.createKey {Function}: Function to create a key for the index view being added.
  • returns {Function}: Function to use as a plugin for templates

Example

var archives = app.create('archives')
  .use(indexer())
  .addIndices(pages);

addIndices

addIndices method decorated onto the given collection Iterators over a list of pages (built with list.paginate) and adds each page to the collection as a new index view

Params

  • pages {Array}: Array of pages return from list.paginate
  • locals {Object}: Optional locals to add to each index view.
  • opts {Object}: Method options to override plugin options.
  • options.createView {Function}: Function to create a view object for the index view being added.
  • options.createKey {Function}: Function to create a key for the index view being added.
  • returns {Object}: Returns collection to enable chaining

Example

collection.addIndices(pages, locals);
  • assemble: Static site generator for Grunt.js, Yeoman and Node.js. Used by Zurb Foundation, Zurb Ink, H5BP/Effeckt,… more | homepage
  • paginationator: Paginate an array into pages of items. | homepage
  • template: Render templates using any engine. Supports, layouts, pages, partials and custom template types. Use template… more | homepage
  • templates: System for creating and managing template collections, and rendering templates with any node.js template engine.… more | homepage

Running tests

Install dev dependencies:

$ npm i -d && npm test

Contributing

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

Author

Brian Woodward

License

Copyright © 2015 Brian Woodward Released under the MIT license.

This file was generated by verb-cli on September 10, 2015.

FAQs

Package last updated on 10 Sep 2015

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