Security News
The Unpaid Backbone of Open Source: Solo Maintainers Face Increasing Security Demands
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
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 1 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
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
Security News
License exceptions modify the terms of open source licenses, impacting how software can be used, modified, and distributed. Developers should be aware of the legal implications of these exceptions.
Security News
A developer is accusing Tencent of violating the GPL by modifying a Python utility and changing its license to BSD, highlighting the importance of copyleft compliance.