Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

metalsmith-layouts

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

metalsmith-layouts - npm Package Compare versions

Comparing version 1.5.4 to 1.6.4

test/fixtures/layout-false/build/layout-false.html

4

History.md

@@ -0,1 +1,5 @@

1.6.4 - February 22, 2016
-------------------------
* allow layout: false to override default template
1.5.4 - February 14, 2016

@@ -2,0 +6,0 @@ -------------------------

9

lib/helpers/check.js

@@ -33,8 +33,5 @@ /**

// Only process files with a specified layout
if(!data.layout && !def) {
return false;
}
return true;
// Only process files with a specified layout or default template. Allow the
// default template to be cancelled by layout: false.
return 'layout' in data ? data.layout : def;
}

@@ -6,3 +6,3 @@ {

"repository": "git://github.com/superwolff/metalsmith-layouts.git",
"version": "1.5.4",
"version": "1.6.4",
"license": "MIT",

@@ -9,0 +9,0 @@ "main": "lib/index.js",

@@ -105,4 +105,6 @@ # metalsmith-layouts

The default layout to use. Can be overridden with the `layout` key in each file's YAML frontmatter. If a `default` layout hasn't been specified, `metalsmith-layouts` will only process files with a `layout` option in their front-matter. Don't forget to specify the file extension. So this `metalsmith.json`:
The default layout to use. Can be overridden with the `layout` key in each file's YAML frontmatter, by passing either a layout or `false`. Passing `false` will skip the file entirely.
If a `default` layout has been specified, `metalsmith-layouts` will process all files unless a pattern has been passed. Don't forget to specify the default template's file extension. So this `metalsmith.json`:
```json

@@ -119,3 +121,3 @@ {

Will apply the `default.html` layout to all files, unless specified otherwise in the frontmatter.
Will apply the `default.html` layout to all files, unless overridden in the frontmatter.

@@ -122,0 +124,0 @@ ### directory

@@ -152,2 +152,14 @@ var assert = require('assert');

it('should ignore files with layout: false', function(done){
Metalsmith('test/fixtures/layout-false')
.use(layouts({engine: 'handlebars', default: 'default.html'}))
.build(function(err){
if (err) {
return done(err);
}
equal('test/fixtures/layout-false/expected', 'test/fixtures/layout-false/build');
done();
});
});
it('should not change file extension by default', function(done) {

@@ -154,0 +166,0 @@ Metalsmith('test/fixtures/rename-option-default')

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc