Skip to content

Instantly share code, notes, and snippets.

@a-ignatov-parc
Created March 12, 2013 12:22
Show Gist options
  • Save a-ignatov-parc/5142479 to your computer and use it in GitHub Desktop.
Save a-ignatov-parc/5142479 to your computer and use it in GitHub Desktop.
handlebars: {
compile: {
options: {
node: true,
wrapped: true,
namespace: 'App.Templates',
processName: function(pathname) {
var filename = pathname
.split('/')
.pop()
.split('.')
.shift(),
wordList = filename.split(/[-_]/g);
for (var i = 1, length = wordList.length; i < length; i++) {
wordList[i] = wordList[i].substr(0, 1).toUpperCase() + wordList[i].substr(1);
}
console.log(pathname, wordList);
return wordList.join('');
}
},
files: {}
}
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment