6

I have been using Alex Gorbatchev's Syntax Highlighter to display code snippets on my blog for the past couple of years. It serves the purpose, but it is a pain to add the code while blogging (I need to use a HTML Encoder and manually add this piece wrapped around a <pre> tag). But, the positive thing is, I know for sure the search engine will crawl the code I have written.

Recently I stumbled upon GitHub Gists and it was really easy to just copy & paste my code in, select the language, and use the embed code on my website. However, will search engines that crawl my blog be able to see the code inside my gist and be able to lead visitors to my blog page?

Stephen Ostermiller
  • 99,822
  • 18
  • 143
  • 364
bragboy
  • 163
  • 5

2 Answers2

4

From what I can see, gist.github.com uses javascript to embed gists such as:

<script src="https://gist.github.com/1234.js"> </script>

And although Google parses some javascript but I doubt 3rd party widgets would get parsed (see update below)

but this exact issue was discussed by Simon Bingham here. He suggests you use the "SEO Friendly Gists" tool which essentially grabs the embed code but ALSO generates a <noscript> version of the gist (that WILL be indexed by google)

Update:

Google Does some Javascript Parsing, and the only official resource I can find on this came from Best approach to have Google index content primarily generated by Javascript where they offer up:

https://developers.google.com/webmasters/ajax-crawling/

Which explains how to have ajax pages indexed.

I've haven't read anything about 3rd party widgets being parsed (nor have I seen any of them own my own sites get parsed) - I think google is focusing on building it's database not improving how your page renders.

If you find some official literature on this, please comment!

electblake
  • 249
  • 2
  • 6
1

I can confirm that the content from a github gist, embedded in a page counts as the page's content for Google. The good thing is that you can test it.

The following gist contains a specific/unique base64 encoded string which is embedded on a website (you can find it here and test it: https://timberlin.de/link-maskierung-javascript-base64/ [disclosure: the content was written by me]

enter image description here

Here is the google search result for it:

enter image description here

If you search in google for the specific string, the URL is shown as result. I.e. the indexing works and google renders the script.

Tim Berlin
  • 61
  • 4