SEO Friendly GitHub Gists

If you look around this site you’ll notice that I’m hosting all my code snippets on GitHub’s awesome gist feature. While this allows me to not maintain syntax highlighter plugins and libraries, as well as lets me change the code snippet without updating the blog is nothing short of awesome. The only thing that kind of sucks is that I/we are losing the ability to have our code be search engine friendly since a gist is a 1-line javascript include. This sucks not so much from the “index me!” perspective, but more of the “if I google a line of code/error, will I find relevant code?”

To tackle this, I ended up with a small project: given a gist ID, generate the embed code along with NOSCRIPT tags so the content is indexable. This will only solve the initial problem, as updates will not propagate to the blog, but… you can always manually update.

Heres how the site ended up: SEO Friendly Gists

This is hosted on GitHub if you’re interested in adding features. (Or hit the “forkable” link near the title)