Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
metalsmith-layouts
Advanced tools
A metalsmith plugin for layouts
This plugin passes your source files to a template as contents
and renders it with the templating engine of your choice. You can use any templating engine supported by consolidate.js. Pass options to it with the Javascript API or CLI. The options are:
engine
: templating engine (required)default
: default template (optional)directory
: directory for the layouts, layouts
by default (optional)pattern
: only files that match this pattern will be processed (optional)$ npm install metalsmith-layouts
Configuration in metalsmith.json
:
{
"plugins": {
"metalsmith-layouts": {
"engine": "handlebars"
}
}
}
Source file src/index.html
:
---
layout: layout.html
title: The title
---
<p>The contents</p>
Layout layouts/layout.html
:
<!doctype html>
<html>
<head>
<title>{{title}}</title>
</head>
<body>
{{{contents}}}
</body>
</html>
Results in dist/index.html
:
<!doctype html>
<html>
<head>
<title>The title</title>
</head>
<body>
<p>The contents</p>
</body>
</html>
This plugin originated in metalsmith-templates issue #35. Splitting up metalsmith-templates
into two plugins was suggested by Ian Storm Taylor. The results are:
metalsmith-templates
with inPlace: true
metalsmith-templates
with inPlace: false
Both plugins have been optimised for each use case. For metalsmith-layouts
the differences with metalsmith-templates are:
inPlace
option has been removedlayout
instead of template
in the front-matter to specify a layoutlayouts
instead of templates
For further documentation see the original metalsmith-templates, but keep these differences in mind.
MIT
1.1.0 - July 19, 2015
FAQs
A metalsmith plugin for layouts.
The npm package metalsmith-layouts receives a total of 2,674 weekly downloads. As such, metalsmith-layouts popularity was classified as popular.
We found that metalsmith-layouts 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.