npm stats
  • Search
  • About
  • Repo
  • Sponsor
  • more
    • Search
    • About
    • Repo
    • Sponsor

Made by Antonio Ramirez

handlebars-helper-asset

0.1.0

@jonschlinkert

npmHomeRepoSnykSocket
Downloads:7
$ npm install handlebars-helper-asset
DailyWeeklyMonthlyYearly

{{asset}} NPM version

Handlebars helper for generating a assetative link from the current page to the specified page.

Installation

Install with npm

npm i handlebars-helper-asset --save-dev

Install with bower

bower install handlebars-helper-asset --save-dev

Register the helper

The easiest way to register the helper with Assemble is to add the module to devDependencies and keywords in your project's package.json:

{
  "devDependencies": {
    "handlebars-helper-asset": "*"
  },
  "keywords": [
    "handlebars-helper-asset"
  ]
}

Alternatively, to register the helper explicitly in the Gruntfile:

grunt.initConfig({
  assemble: {
    options: {
      // the 'handlebars-helper-asset' npm module must also be listed in
      // devDependencies for assemble to automatically resolve the helper
      helpers: ['handlebars-helper-asset', 'foo/*.js']
    },
    files: {
      'dist/': ['src/templates/*.hbs']
    }
  }
});

Usage

With the helper registered, you may now begin using it in your templates:

<link rel="stylesheet" href="{{asset 'css/styles.css'}}">

Author

Jon Schlinkert

  • github/jonschlinkert
  • twitter/jonschlinkert

License and Copyright

Copyright (c) 2014 Jon Schlinkert, contributors. Licensed under the MIT License