jst-templates-brunch

1.7.2 • Public • Published

Wrap templates to JST function for Brunch

Installation

npm install --save jst-templates-brunch

Usage

For instance, use with jaded-brunch

  1. Install the plugin
npm install --save jaded-brunch jst-templates-brunch

make sure the jaded-brunch is prior than jst-templates-brunch in package.json

  1. Set joinTo attribute for templates in config.coffee, e.g.
templates:
  joinTo:
    'templates.js': /^app/
  1. In your markup, include templates.js:
<script type="text/javascript" src="/templates.js"></script>
  1. Use the template function in your app

There is a jade file located in 'app/apps/header/templates/header.jade'.

You can reference the template function in

templateFn = JST('apps/header/templates/header')
// OR
templateFn = JST['apps/header/templates/header']

Options

namespace

Specify the namespace of the template function

Default: JST

plugins:
  jsttemplates:
    namespace: 'MyTemplateFn'

basePath

Specify the base path to omit in the template function name

Default: app

keepExt

Keep the template file extension in the template function name or not

Default: false

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.7.2
    1
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.7.2
    1
  • 1.7.1
    0
  • 1.7.0
    0
  • 0.1.0
    0
  • 0.0.1
    1

Package Sidebar

Install

npm i jst-templates-brunch

Weekly Downloads

1

Version

1.7.2

License

none

Last publish

Collaborators

  • jarvis.ai
  • jarvisaoieong