node.js - Connect assets with handlebars? -


the typical way include connect assets file

!= css("main") 

that .jade though. using handlebars , have no clue how can add file?

i using node-sass well.

just guessing, works (see blog post):

var connectassets = require("connect-assets")(); app.use(connectassets); var hbs = require('hbs'); hbs.registerhelper('css', function() {   var css = connectassets.options.helpercontext.css.apply(this, arguments);   return new hbs.safestring(css); }); 

Comments

Popular posts from this blog

java - HTTP Status 500 - An exception occurred processing JSP page /second.jsp at line 15 -

php - Using str_replace to translate a MySQL Table in html -

asp.net mvc - Cannot display error message on Editor or EditorFor -