Socket
Socket
Sign inDemoInstall

handlebars-helper-url

Package Overview
Dependencies
0
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    handlebars-helper-url

Handlebars helper that format urls depending on the environment


Version published
Maintainers
1
Install size
3.97 kB
Created

Readme

Source

handlebars-helper-url

Handlebars helper that format urls depending on the environment. This plugin is used along with metalsmith-metadata.

Installation

npm install handlebars-helper-url

Usage

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.

License

MIT License, see LICENSE for details.

Keywords

FAQs

Last updated on 02 Nov 2016

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc