Skip to content

Instantly share code, notes, and snippets.

@Heydon
Created December 13, 2015 18:30
Show Gist options
  • Save Heydon/12fd8b4947b2a05fe5f3 to your computer and use it in GitHub Desktop.
Save Heydon/12fd8b4947b2a05fe5f3 to your computer and use it in GitHub Desktop.
Handlebars.registerHelper('slugify', function(title) {
return title.toLowerCase()
.replace(/ /g,'-')
.replace(/[^\w-]+/g,'');
});
@ZaneHannanAU
Copy link

ZaneHannanAU commented Nov 26, 2016

Line 3

.replace(/\s+/g,'-')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment