Comparing version 0.2.5 to 0.2.6
@@ -245,5 +245,8 @@ /*! | ||
content = content.replace(this.regex, tmpl.content); | ||
content = _.template(content, this.context); | ||
return { | ||
data: this.context, | ||
content: content.replace(this.regex, tmpl.content), | ||
content: content, | ||
regex: this.regex, | ||
@@ -250,0 +253,0 @@ tag: tag |
{ | ||
"name": "layouts", | ||
"description": "Wrap templates with layouts. Layouts can be nested and optionally use other layouts.", | ||
"version": "0.2.5", | ||
"version": "0.2.6", | ||
"homepage": "https://github.com/jonschlinkert/layouts", | ||
@@ -6,0 +6,0 @@ "author": { |
@@ -21,3 +21,3 @@ /*! | ||
name: path.basename(filepath, path.extname(filepath)), | ||
layout: obj.data && obj.data.layout, | ||
data: obj.data, | ||
content: obj.content.replace(/^\s*/, '') | ||
@@ -29,3 +29,3 @@ }; | ||
var obj = page(filepath); | ||
layouts.setLayout(obj.name, obj.layout, obj.content); | ||
layouts.setLayout(obj.name, obj.data, obj.content); | ||
}); | ||
@@ -59,3 +59,3 @@ | ||
'A above', | ||
'I\'m a <%= title %>', // should not be compiled | ||
'I\'m a Foo', | ||
'A below', | ||
@@ -62,0 +62,0 @@ 'B below', |
@@ -24,3 +24,3 @@ /*! | ||
layouts.setLayout({f: { layout: 'last', content: 'F above\n{{body}}\nF below' }}); | ||
layouts.setLayout({first: { layout: 'a', content: 'I\'m a <%= title %>' }}); | ||
layouts.setLayout({first: { title: 'first', layout: 'a', content: 'I\'m a <%= title %>' }}); | ||
@@ -37,3 +37,3 @@ it('should extend the `cache`.', function () { | ||
'A above', | ||
'I\'m a <%= title %>', // should not be compiled | ||
'I\'m a first', | ||
'A below', | ||
@@ -54,3 +54,3 @@ 'B below', | ||
layouts.setLayout('first', 'a', 'I\'m a <%= title %>'); | ||
layouts.setLayout('first', 'a', 'I\'m a < %= title %>'); | ||
layouts.setLayout('a', 'b', 'A above\n{{body}}\nA below'); | ||
@@ -74,3 +74,3 @@ layouts.setLayout('b', 'c', 'B above\n{{body}}\nB below'); | ||
'A above', | ||
'I\'m a <%= title %>', // should not be compiled | ||
'I\'m a < %= title %>', // should not be compiled | ||
'A below', | ||
@@ -92,3 +92,3 @@ 'B below', | ||
layouts.setLayout('first', {layout: 'a'}, 'I\'m a <%= title %>'); | ||
layouts.setLayout('first', {title: 'first', layout: 'a'}, 'I\'m a <%= title %>'); | ||
layouts.setLayout('a', {layout: 'b'}, 'A above\n{{body}}\nA below'); | ||
@@ -112,3 +112,3 @@ layouts.setLayout('b', {layout: 'c'}, 'B above\n{{body}}\nB below'); | ||
'A above', | ||
'I\'m a <%= title %>', // should not be compiled | ||
'I\'m a first', | ||
'A below', | ||
@@ -129,3 +129,3 @@ 'B below', | ||
layouts.setLayout('first', {layout: 'a', content: 'I\'m a <%= title %>'}); | ||
layouts.setLayout('first', {title: 'first', layout: 'a', content: 'I\'m a <%= title %>'}); | ||
layouts.setLayout('a', {layout: 'b', content: 'A above\n{{body}}\nA below'}); | ||
@@ -149,3 +149,3 @@ layouts.setLayout('b', {layout: 'c', content: 'B above\n{{body}}\nB below'}); | ||
'A above', | ||
'I\'m a <%= title %>', // should not be compiled | ||
'I\'m a first', | ||
'A below', | ||
@@ -174,3 +174,3 @@ 'B below', | ||
f: { layout: 'last', content: 'F above\n{{body}}\nF below' }, | ||
first: { layout: 'a', content: 'I\'m a <%= title %>' } | ||
first: { title: 'first', layout: 'a', content: 'I\'m a <%= title %>' } | ||
}); | ||
@@ -188,3 +188,3 @@ | ||
'A above', | ||
'I\'m a <%= title %>', // should not be compiled | ||
'I\'m a first', | ||
'A below', | ||
@@ -191,0 +191,0 @@ 'B below', |
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
39620
29
941