Skip to content

Instantly share code, notes, and snippets.

@JBreit
Forked from Heydon/slugify-helper.js
Created December 22, 2015 01:54
Show Gist options
  • Save JBreit/a82a1e988f2f4217a7c3 to your computer and use it in GitHub Desktop.
Save JBreit/a82a1e988f2f4217a7c3 to your computer and use it in GitHub Desktop.
Handlebars.registerHelper('slugify', function(title) {
return title.toLowerCase()
.replace(/ /g,'-')
.replace(/[^\w-]+/g,'');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment