rstacruz / sinatra-assetpack

Package your assets transparently in Sinatra.
http://ricostacruz.com/sinatra-assetpack/
MIT License
542 stars 96 forks source link

How do you use JST? #148

Open mrrooijen opened 10 years ago

mrrooijen commented 10 years ago

Trying to figure out if it's possible to use jst templates. This is what I have:

class App < Sinatra::Base
  set :root, File.expand_path("../..", __FILE__)
  register Sinatra::AssetPack

   assets do
     serve "/javascripts" , from: "assets/javascripts"
     serve "/stylesheets" , from: "assets/stylesheets"
     serve "/images"      , from: "assets/images"

     js :application, [
       "/javascripts/vendor/jquery.js",
       "/javascripts/vendor/angular.js",
       "/javascripts/vendor/angular-ui-router.js",

       "/javascripts/templates/*.js", # Help
       "/javascripts/services/*.js",
       "/javascripts/filters/*.js",
       "/javascripts/directives/*.js",
       "/javascripts/controllers/*.js",

       "/javascripts/*.js"
     ]
   end
end

How can I tell sinatra-assetpack to grab and render the templates? Let's say I want to use eco, what do I need to change in this file, and what file extension(s) should I be using?

Thanks!