Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compile to target dir #10

Open
zackd opened this issue Aug 14, 2012 · 2 comments
Open

compile to target dir #10

zackd opened this issue Aug 14, 2012 · 2 comments

Comments

@zackd
Copy link

zackd commented Aug 14, 2012

hey, maybe I'm being dumb here .. but cant find any specific docs.. Is it possible to compile a src dir containing multiple handlebars templates to a target dir, or do we need to specify target template name for each file?

@luccastera
Copy link
Collaborator

Yes, that's possible. Put the following in your grunt.js file:

    handlebars: {
      all: {
        src: 'src/templates',
        dest: 'public/js/templates.js'
      }
    },

where templates is a folder that contains all your *.handlebars files.

@luccastera
Copy link
Collaborator

It compiles them all into one file called templates.js in the previous example.

Include that file on your page/app, and you can call your templates as:

Handlebars.my_template

if the file was: my_template.handlebars

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants