Xindi CMS

Xindi CMS is a small, lightweight and flexible content management system. It's great for web developers looking for a simple way to make site content editable by their clients.

Open source, free and flexible, Xindi is available in CFML and PHP versions.

Find out more »

About Me

I am a web developer living and working in Exeter, Devon (United Kingdom). I use my blog to document and share the things I learn and I hope fellow developers will find it to be a useful resource.

Read more »

Recently I converted the code samples on my blog to use GitHub Gist.

Gist is a simple way to share snippets and pastes with others. All gists are git repositories, so they are automatically versioned, forkable and usable as a git repository.

Although I'm a big fan of Gist I was concerned that, because JavaScipt is used to render gists, my code samples would not be indexable by Google. I researched this and, although I couldn't find a conclusive answer, the consensus seemed to confirm my suspicion that Google does not index content rendered using JavaScript.

Gist also has a couple of other drawbacks:

  1. anyone viewing my blog with JavaScript disabled will not see the code samples.
  2. if Gist is ever taken offline my code samples would be lost.

Fortunately there is a solution to these problems. SEO Friendly Gists is a tool created by Rob Hurring. Quite simply you enter the id of your gist, click 'Generate', and the tool will create some HTML for you. The HTML includes the usual Gist JavaScript embed code followed by the code sample itself provided as noscript content. This HTML can then be dropped into your website.

Although Google doesn't index content rendered using JavaScript it does index noscript content. Also, anyone now viewing my blog with JavaScript disabled will see the noscript content. Finally, I have a backup of all my code samples on my blog so if Gist is ever taken offline my code can be recovered.

I think this is a great solution, but there are a couple of gotchas to look out for:

  1. if you ever amend a gist you'll need to re-generate the embed code to ensure the noscript content is correct.
  2. inside the noscript tag you'll need to add a pre tag to format your code nicely.

Tags


Share


Comments

Be the first to add a comment!

Add Comment

Your email address will not be displayed on this blog.

The URL of your blog or web site.

2 + 3 =
Host Media ColdFusion Hosting
"Perfection is the enemy of the good."

Gustave Flaubert, French realist novelist (1821-1880)