templates
Advanced tools
Comparing version 0.1.19 to 0.1.20
@@ -32,2 +32,3 @@ 'use strict'; | ||
var keys = Object.keys(List.prototype); | ||
keys.forEach(function(key) { | ||
@@ -34,0 +35,0 @@ if (typeof res[key] !== 'undefined') return; |
@@ -76,3 +76,3 @@ 'use strict'; | ||
Views.prototype.use = function(fn) { | ||
var plugin = fn.call(this, this); | ||
var plugin = fn.call(this, this, this.options); | ||
if (typeof plugin === 'function') { | ||
@@ -79,0 +79,0 @@ this.plugins.push(plugin); |
{ | ||
"name": "templates", | ||
"description": "System for creating and managing template collections, and rendering templates with any node.js template engine. Can be used as the basis for creating a static site generator or blog framework.", | ||
"version": "0.1.19", | ||
"version": "0.1.20", | ||
"homepage": "https://github.com/jonschlinkert/templates", | ||
@@ -6,0 +6,0 @@ "author": "Jon Schlinkert (https://github.com/jonschlinkert)", |
@@ -5,2 +5,51 @@ # templates [![NPM version](https://badge.fury.io/js/templates.svg)](http://badge.fury.io/js/templates) | ||
**Features** | ||
* create custom view collections using `app.create('foo')` | ||
* register any template engine for rendering views | ||
* register helpers | ||
* partial support | ||
* plugins and middleware | ||
**Example** | ||
This is just a very small glimpse at the `templates` API! | ||
```js | ||
var templates = require('templates'); | ||
var app = templates(); | ||
// create a collection | ||
app.create('pages'); | ||
// add views to the collection | ||
app.page('a.html', {content: 'this is <%= foo %>'}); | ||
app.page('b.html', {content: 'this is <%= bar %>'}); | ||
app.page('c.html', {content: 'this is <%= baz %>'}); | ||
app.pages.getView('a.html') | ||
.render({foo: 'home'}, function (err, view) { | ||
//=> 'this is home' | ||
}); | ||
``` | ||
<!-- toc --> | ||
* [Install](#install) | ||
* [Usage](#usage) | ||
* [API](#api) | ||
- [Collections](#collections) | ||
- [List](#list) | ||
- [View](#view) | ||
- [Related projects](#related-projects) | ||
- [Running tests](#running-tests) | ||
- [Contributing](#contributing) | ||
- [Author](#author) | ||
- [License](#license) | ||
_(Table of contents generated by [verb](https://github.com/verbose/verb))_ | ||
<!-- tocstop --> | ||
## Install | ||
@@ -7,0 +56,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
118422
751