tweak example JS (the slugify() function was not self-contained)