Use Netlify as a URL Shortener

The idea is to have a dedicated repo with only a _redirects file in there which you constantly update and push (and thus deploy). To help automate that, Kent C. Dodds create a package named netlify-shortener which does that for you:

  1. Generates a short code if one is not provided
  2. Validates your URL is a real URL
  3. Adds the URL to the top of _redirects
  4. Runs a git commit and push (this will trigger netlify to deploy your new redirect)
  5. Copies the short URL to your clipboard

The video embedded at the top of this post shows you how to implement this (feel free to fast forward to the 10 minute mark)

netlify-shortener

My inc.functions.php – Part 2 : Creating a post slug

PHP Willow TreeIn the second part of this series (Click for part 1) another tiny, yet handy PHP function is described. Some of you might already have discovered the power of having a "post slug" in an URI. Not only does a post slug give an indication to the user (he can tell by the URI what the post/link is all about), it also improves your ranking within search engines as they mark a word in the URI as being important and relevant.

Continue reading “My inc.functions.php – Part 2 : Creating a post slug”