Skip to content

Instantly share code, notes, and snippets.

@Kernix13
Created September 15, 2022 15:23
Show Gist options
  • Save Kernix13/c6035f82c5205fe9cb7268f8201bf1db to your computer and use it in GitHub Desktop.
Save Kernix13/c6035f82c5205fe9cb7268f8201bf1db to your computer and use it in GitHub Desktop.
Convert blog title to URL slug (my first gist)
const blogTitle = "How to create a GitHub Gist";
const urlSlug = blogTitle.toLowerCase().split(" ").filter(word => word !== "").join("-");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment