
Research
Security News
The Growing Risk of Malicious Browser Extensions
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
handlebars-helper-url
Advanced tools
Handlebars helper that format urls depending on the environment
Handlebars helper that format urls depending on the environment. This plugin is used along with metalsmith-metadata.
npm install handlebars-helper-url
Refer to metalsmith-metadata
to know more, but basically you need to create your metadata as a YAML file in the root of your sources directory:
// globals.yaml
author:
name: Antonio Hernández
email: ahdiaz [at] gmail
site:
title: Work in progress
url:
devel: /
prod: http://ahdiaz.euler.es/
In your metalsmith script:
var handlebars = require('handlebars');
var metadata = require('metalsmith-metadata');
var hbturl = require('handlebars-helper-url')(handlebars);
new Metalsmith(__dirname)
.use(metadata({
globals: './path/to/globals.json'
}))
.build();
When you build your site the urls will be relatives or absolutes to your site depending on the specified environment:
$ NODE_ENV=production node index.js
handlebars
Object
A Handlebars instance.
MIT License, see LICENSE for details.
FAQs
Handlebars helper that format urls depending on the environment
We found that handlebars-helper-url 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 researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
Research
Security News
An in-depth analysis of credential stealers, crypto drainers, cryptojackers, and clipboard hijackers abusing open source package registries to compromise Web3 development environments.
Security News
pnpm 10.12.1 introduces a global virtual store for faster installs and new options for managing dependencies with version catalogs.