
Security News
Browserslist-rs Gets Major Refactor, Cutting Binary Size by Over 1MB
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
gulp-multi-renderer
Advanced tools
plugin to render contents using various template engines.
npm install --save-dev gulp-multi-renderer
gulpfile.js
var frontMatter = require('gulp-front-matter');
var marked = require('gulp-marked');
var renderer = require('gulp-multi-renderer');
gulp.src('./src/*.md')
.pipe(frontMatter({
remove: true
}))
.pipe(renderer({
target: "content"
}))
.pipe(marked())
.pipe(renderer({}))
.pipe(gulp.dest('./dist'));
});
markdown with YAML front matter.
---
title: My Awesome Document
---
Hello, This is <%- frontMatter.title %>.
after pre-process.
Hello, This is My Awesome Document.
layout/default.ejs
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<title><%= frontMatter.title %></title>
</head>
<body>
<%- contents %>
</body>
</html>
after post-process.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<title>My Awesome Document</title>
</head>
<body>
<p>Hello, This is My Awesome Document.</p>
</body>
</html>
Type: hash
Default: { target: "wrap", property: "forntMatter", templateDir: "./layouts"}
Type: String
Default: wrap
When content
is specified, it render embedded template within file.contents
. Default template is ejs. If you want to user mustache, set mustache
to frontMatter.local
.
When wrap
is specified, you can refer file.contents
through contents
variable in the template file. Default template file is ./layouts/default.ejs
. You can specify template file by frontMatter.layout
.
You can also use mustache or jade for template file.
Type: String
Default: forntMatter
a Object name of which contains local variables.
Type: String
Default: ./layouts/
A directory in which template files are placed.
FAQs
plugin to render contents using various template engines.
The npm package gulp-multi-renderer receives a total of 4 weekly downloads. As such, gulp-multi-renderer popularity was classified as not popular.
We found that gulp-multi-renderer 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
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.