Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tag: v2.1.0
Fetching contributors…

Cannot retrieve contributors at this time

41 lines (27 sloc) 1.093 kb

Handlebars Plugin for DocPad

Adds support for the Handlebars templating engine to DocPad

Convention: .anything.handlebars|hbs|hb

Install

npm install --save docpad-plugin-handlebars

Usage

The plugin also supports helpers and partials. They can be defined in the docpad settings.

Here is a small example:

{
  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>'
}

History

You can discover the history inside the History.md file

License

Licensed under the incredibly permissive MIT License
Copyright © 2012 Mike Moulton

Jump to Line
Something went wrong with that request. Please try again.