
Security News
Open Source CAI Framework Handles Pen Testing Tasks up to 3,600× Faster Than Humans
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
layout-wrapper
Advanced tools
Wrap the contents in the layout template. gulpfriendly.
This module is designed to be used with gulp or bulbo.
NOTE: See also layout1, which is a more simple and flexible version of this module.
npm install layout-wrapper
This module works with gulp's file stream.
gulpfile.js:
const frontMatter = require('gulp-front-matter')
const wrapper = require('layout-wrapper')
gulp.src('src/pages/*.html')
.pipe(frontMatter())
.pipe(wrapper({
layout: 'src/layouts',
data: {name: 'world'},
engine: 'nunjucks'
}))
.pipe(gulp.dest('site/'))
Note You still need to install the template engine. (In the above case, you need to install nunjucks
)
src/pages/sample.html:
---
title: Hello
layout: default
---
<p>Hello, {{ name }}!</p>
src/layouts/default.nunjucks:
<html>
<head>
<title>{{ file.frontMatter.title }}</title>
</head>
<body>
{{ contents }}
</body>
</html>
The above settings outputs the following html into the path site/sample.html
:
<html>
<head>
<title>Hello</title>
</head>
<body>
<p>Hello, world!</p>
</body>
</html>
bulbofile.js:
const frontMatter = require('gulp-front-matter')
const wrapper = require('layout-wrapper')
asset('src/pages/*.html')
.pipe(frontMatter())
.pipe(wrapper({
layout: 'src/layouts',
data: {name: 'world'},
engine: 'nunjucks'
}))
const wrapper = require('layout-wrapper')
lodash
. Please see the document of consolidate.js for what's available here.frontMatter
.'layout'
.default
.'.' + engine name
e.g. .lodash
.ejs
.nunjucks
etc.This returns the transform stream from vinyl to vinyl. This transforms
You can also use alias methods.
gulp.src('src/pages/*.html')
.pipe(frontMatter())
.pipe(wrapper.nunjucks({
layout: 'src/layouts',
data: {name: 'world'}
}))
.pipe(gulp.dest('site/'))
The above is equivalent of engine: 'nunjucks'
call of wrapper
.
MIT
FAQs
Wrap the contents in the layout template. gulpfriendly.
The npm package layout-wrapper receives a total of 54 weekly downloads. As such, layout-wrapper popularity was classified as not popular.
We found that layout-wrapper demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.
Security News
CVEForecast.org uses machine learning to project a record-breaking surge in vulnerability disclosures in 2025.