Skip to content

Commit

Permalink
Added compatibility with consolidate.js
Browse files Browse the repository at this point in the history
  • Loading branch information
baryshev committed Aug 5, 2012
1 parent 95defb9 commit c09c790
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 20 deletions.
12 changes: 6 additions & 6 deletions README.md
Expand Up @@ -21,7 +21,7 @@ JavaScript template engine.
```js
var JUST = require('just');

var just = new JUST({ root : __dirname + '/view' });
var just = new JUST({ root : __dirname + '/view', useCache : true, ext : '.html' });

just.render('page', { title: 'Hello, World!' }, function(error, html) {
console.log(error);
Expand All @@ -37,7 +37,7 @@ var JUST = require('just');
var just = new JUST({ root : {
layout: '<html><head><title><%= title %></title></head><body><%*%></body></html>',
page: '<%! layout %><p>Page content</p>'
}
}, useCache : true
});

just.render('page', { title: 'Hello, World!' }, function(error, html) {
Expand Down Expand Up @@ -148,9 +148,9 @@ Blocks supports more than one level of inheritance and may be redefined.
## Options

- `root` Templates root folder or JavaScript object containing templates
- `ext` Extension of templates, defaulting to '.html' (not used for JavaScript objects as root)
- `useCache` Compiled functions are cached, defaulting to true
- `watchForChanges` Automatic reloading of changed templates, defaulting to false (useful for debugging, not supported for client-side)
- `ext` Extension of templates, defaulting to '' (not used for JavaScript objects as root)
- `useCache` Compiled functions are cached, defaulting to false
- `watchForChanges` Automatic reloading of changed templates, defaulting to false (useful for debugging with enabled useCache, not supported for client-side)
- `open` Open tag, defaulting to '<%'
- `close` Closing tag, defaulting to '%>'

Expand All @@ -159,7 +159,7 @@ Blocks supports more than one level of inheritance and may be redefined.
Basically, include [just.min.js](https://github.com/baryshev/just/tree/master/just.min.js) to a page and JUST ready to use.

```js
var just = new JUST({ root : '/view' });
var just = new JUST({ root : '/view', useCache : true });

just.render('page', { title: 'Hello, World!' }, function(error, html) {
console.log(error);
Expand Down
2 changes: 1 addition & 1 deletion examples/example.js
@@ -1,6 +1,6 @@
var JUST = require('./../index');

var just = new JUST({ root : __dirname + '/view' });
var just = new JUST({ root : __dirname + '/view', useCache : true, ext : '.html' });

just.render('page', { title: 'Hello, World!' }, function(error, html) {
console.log(error);
Expand Down
4 changes: 2 additions & 2 deletions just.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c09c790

Please sign in to comment.