kadamwhite/backbone-wordpress-demo — pull request #10 by kadamwhite (2013-08-15 18:43:07+00:00)
Title: Move the markup to a partial and use Grunt to pre-compile the template

To enable our gallery's markup to be cached along with the rest of our JS, we move it out of the PHP and into an external `.tmpl` file. We then use Grunt (with the grunt-contrib-jst module) to pre-compile the template, and bundle it up with the rest of our scripts. Now the template is automatically available as a method within our JavaScript—we don't even have to call Underscore directly from within our script anymore! (note: Underscore must still be enqueued, or the compiled template code will fail)