Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GitHub source dynamic navigation

I was browsing thought GitHub today and noticed that the individual repository navigation doesn't use hash-bangs in the URL /#! or /# and the back button still works. How do you think they are accomplishing this? How does this affect search engine crawling from Googlebot? I know it looks for # in the url.

I'm really quite curious as I know using /# is quite debatable.

Here's an example: https://github.com/mirah/pindah

Thanks!

like image 979
Nate Avatar asked Feb 10 '11 01:02

Nate


2 Answers

They blogged about it a while back:

https://github.com/blog/760-the-tree-slider

like image 173
RJ Regenold Avatar answered Nov 19 '22 20:11

RJ Regenold


The effect is implemented history.pushState() function and handlers on the popstate event — both a part of the HTML5 DOM interface in some browsers.

Clicking the link uses pushState() to update the location and load new data into the page without reloading the whole page. Handling popstate makes the back button work correctly.

The GutHub blog calls their particular usage the “Tree Slider” (it loads the content for tree members and visually slides it into place). The effect and its implementation was described on the GitHub blog.

like image 41
Chris Johnsen Avatar answered Nov 19 '22 22:11

Chris Johnsen