Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
docpad-plugin-handlebars
Advanced tools
Adds support for the Handlebars templating engine to DocPad
Convention: .(inlinejs|js|anything).(handlebars|hbs|hb)
npm install --save docpad-plugin-handlebars
For the plugin to support helpers and partials, you'll have to add something like the following to your docpad configuration file manually:
# ...
plugins:
handlebars:
helpers:
# Expose docpads 'getBlock' function to handlebars
getBlock: (type, additional...) ->
additional.pop() # remove the hash object
@getBlock(type).add(additional).toHTML()
partials:
title: '<h1>{{document.title}}</h1>'
goUp: '<a href="#">Scroll up</a>'
# ...
If the document extension is .(inlinejs|js).(handlebars|hbs|hb)
, the plugin will produce a precompiled template. In this case, you can customise the precompiled template via the following:
# ...
plugins:
handlebars:
precompileOpts:
wrapper: "default"
# ...
Available values for the wrapper option are:
"default"
: Produces a handlebars wrapper like:
(function() {
var template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {};
templates['theSlugOfTheFile'] = template(function (Handlebars,depth0,helpers,partials,data) {
...
})
})();
"amd"
: Produces a AMD handlebars wrapper like:
define(['handlebars'], function(Handlebars) {
var template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {};
templates['theSlugOfTheFile'] = template(function (Handlebars,depth0,helpers,partials,data) {
...
});
});
"none"
: Produces a basic wrapper like:
function (Handlebars,depth0,helpers,partials,data) {
...
}
You can discover the history inside the History.md
file
You can discover the contributing instructions inside the Contributing.md
file
Licensed under the incredibly permissive MIT License
Copyright © 2012+ Mike Moulton mike@meltmedia.com
v2.2.2 2013 June 26
FAQs
Adds support for the Handlebars templating engine to DocPad.
The npm package docpad-plugin-handlebars receives a total of 6 weekly downloads. As such, docpad-plugin-handlebars popularity was classified as not popular.
We found that docpad-plugin-handlebars demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 6 open source maintainers 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
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.