manila
Advanced tools
Comparing version 2.0.1 to 2.0.2
@@ -69,9 +69,8 @@ 'use strict'; | ||
root, | ||
extension = '.mnla'; | ||
extension = 'mnla'; | ||
root = opts.root || path.dirname(require.main.filename); | ||
viewsDir = path.join(root, 'views'); | ||
viewsDir = path.join(opts ? opts.views || viewsDir : viewsDir, '/'); | ||
partialsDir = path.join(root, opts ? opts.partials || viewsDir : viewsDir, '/'); | ||
extension = opts.extension ? '.' + opts.extension : extension; | ||
viewsDir = path.join(root, opts.views || 'views', '/'); | ||
partialsDir = path.join(root, opts.partials || 'views', '/'); | ||
extension = '.' + (opts.extension || extension); | ||
extension = extension.replace('..', '.'); | ||
@@ -84,3 +83,3 @@ | ||
if (filepath.indexOf(root) !== 0) { | ||
filepath = path.join(root, viewsDir, filepath); | ||
filepath = path.join(viewsDir, filepath); | ||
} | ||
@@ -91,3 +90,3 @@ // Add extension if missing | ||
} | ||
read(filepath, { encoding: 'utf8' }, function(err, template) { | ||
@@ -94,0 +93,0 @@ |
{ | ||
"name": "manila", | ||
"version": "2.0.1", | ||
"version": "2.0.2", | ||
"description": "A simple template engine for Node", | ||
@@ -5,0 +5,0 @@ "main": "manila.js", |
@@ -94,3 +94,3 @@ # Manila | ||
`partials`: the directory in which to look for partial mnla files to use with `<<include ... >>` tags, realtive to the root. Defaults to the same directory as the `views` setting. | ||
`partials`: the directory in which to look for partial mnla files to use with `<<include ... >>` tags, realtive to the root. Defaults to `views`. | ||
@@ -97,0 +97,0 @@ `extension`: the file extension of your views/partials. Defaults to `'.mnla'`. |
14153
246