var queue = 0;
var toBeLoaded = 0;
var loaded = 0;

function setTitle() {
  $('#title').html(config.title);
  document.title = config.title;
}

function setNavbar() {
 if (document.width >= 1560) {
  for (var i = 0; i < config.navbar.length; i++) {
    var dom = '<a href="' + config.navbar[i].link + '" class="button">' + config.navbar[i].text + '</a>';
    if (i != 0)
      $('<span> • </span>').appendTo('#navbar');
    $(dom).appendTo('#navbar');
  }
  } else {
  for (var i = 0; i < config.navbarS.length; i++) {
    var dom = '<a href="' + config.navbar[i].link + '" class="button">' + config.navbar[i].text + '</a>'; //add S
    if (i != 0)
      $('<span> • </span>').appendTo('#navbar');
    $(dom).appendTo('#navbar');
  }
  }
}

function createPlaceholders() {
  for (var i = 0; i < config.atOnce; i++) {
    if (toBeLoaded != config.posts.length) {
      var dom = '<div id="post' + config.posts[toBeLoaded] + '"></div>';
      $(dom).appendTo('#posts');
      toBeLoaded++;
    } else
      break;
  }
}

function navbar_relocate() {
    var window_top = $(window).scrollTop();
    var div_top = $('#navbar-anchor').offset().top;
    if (window_top > div_top) {
        $('#navbar').addClass('stick');
        $('#navbar-anchor').height($('#navbar').outerHeight());
    } else {
        $('#navbar').removeClass('stick');
        $('#navbar-anchor').height(0);
    }
}

function loadPosts() {
  $('#loader').show();
  for (;loaded < toBeLoaded; loaded++) {
    queue ++;
    $.get('https://api.github.com/gists/' + config.posts[loaded], function (data) {
      var gist = '';
      for (var j in data.files)
        gist = gist + marked.parse(data.files[j].content);
      var dom = '<div class="post">' +
                '<div class="post-text">' + gist + '</div>' +
                //'<span class="date"><a href="' + data.html_url + '">' + new Date(data.updated_at) + '</a></span>' +
                '<span class="date">' + new Date(data.updated_at) + '</a></span>' +
                ' • <span class="author">Posted by ' + data.owner.login + '</span>' +
                //' • <span class="author">Posted by <a href="https://github.com/' + data.owner.login + '">' + data.owner.login + '</a></span>' +
                '</div><hr>';
      $(dom).appendTo('#post' + data.id);
    }, 'json').done(function() {
      queue --;
      if (queue == 0)
        $('#loader').hide();
    });
  }
}

function loadFooter() {
  $('#footer-text').html(config.footerText);
}

function loadOlder() {
  createPlaceholders();
  loadPosts();
  if (toBeLoaded == config.posts.length)
    $('#old-posts').hide();
}

$(function() {
    $(window).scroll(navbar_relocate);
    navbar_relocate();
});

$('#loader').hide();
setTitle();
setNavbar();
loadFooter();
$('#old-posts').bind('click', loadOlder);
createPlaceholders();
loadPosts();
if (toBeLoaded == config.posts.length)
  $('#old-posts').hide();

@@ -495,17 +495,16 @@
 g.navbar
-S
 .length;
@@ -502,32 +502,40 @@
 r.length; i++) %7B
+ //add S
 %0A    var dom = '

Update grite.js