Ninety-nine Pitchers of Malt

    @pattern-lab/engine-handlebars

    5.14.3 • Public • Published

    The Handlebars PatternEngine for Pattern Lab / Node

    To install the Handlebars PatternEngine in your edition, npm install --save @pattern-lab/engine-handlebars should do the trick.

    Supported features

    Helpers

    To add custom helpers or otherwise interact with Handlebars directly, create a file named patternlab-handlebars-config.js in the root of your Pattern Lab project, or override the default location by specifying one or several glob patterns in the Pattern Lab config:

      {
        ...
        "engines": {
          "handlebars": {
            "extend": [
              "handlebars-helpers.js",
              "helpers/**/*.js"
            ]
          }
        }
      }

    Each file should export a function which takes Handlebars as an argument.

    module.exports = function(Handlebars) {
      // Put helpers here
    
      Handlebars.registerHelper('fullName', function(person) {
        // Example: person = {firstName: "Alan", lastName: "Johnson"}
        return person.firstName + " " + person.lastName;
      });
    };

    Install

    npm i @pattern-lab/engine-handlebars

    DownloadsWeekly Downloads

    704

    Version

    5.14.3

    License

    MIT

    Unpacked Size

    19.2 kB

    Total Files

    8

    Last publish

    Collaborators

    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar