Last active
December 1, 2019 23:28
-
-
Save jcblw/5941917 to your computer and use it in GitHub Desktop.
This is some useful helpers that allow you to use handlebar templates with connect-assets in node.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = function( hbs ){ | |
hbs.registerHelper( "js", function( context ){ | |
if( typeof js === "function" ){ | |
return js( context ); | |
}else{ | |
return "" | |
} | |
}); | |
hbs.registerHelper( "css", function( context ){ | |
if( typeof css === "function" ){ | |
return css( context ); | |
}else{ | |
return "" | |
} | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment