text: (function($){
    
    // Caption
    $('.article-entry').each(function(i){
      $(this).find('img').each(function(){
        if ($(this).parent().hasClass('fancybox')) return;
  
        var alt = this.alt;
  
        if (alt) $(this).after('<span class="caption">' + alt + '</span>');
  
        $(this).wrap('<a href="' + this.src + '" title="' + alt + '" class="fancybox"></a>');
      });
  
      $(this).find('.fancybox').each(function(){
        $(this).attr('rel', 'article' + i);
      });
    });
  
    if ($.fancybox){
      $('.fancybox').fancybox();
    }
  
    // Mobile nav
    var $container = $('#container'),
      isMobileNavAnim = false,
      mobileNavAnimDuration = 200;
  
    var startMobileNavAnim = function(){
      isMobileNavAnim = true;
    };
  
    var stopMobileNavAnim = function(){
      setTimeout(function(){
        isMobileNavAnim = false;
      }, mobileNavAnimDuration);
    }
  
    $('#main-nav-toggle').on('click', function(){
      if (isMobileNavAnim) return;
  
      startMobileNavAnim();
      $container.toggleClass('mobile-nav-on');
      stopMobileNavAnim();
    });
  
    $('#wrap').on('click', function(){
      if (isMobileNavAnim || !$container.hasClass('mobile-nav-on')) return;
  
      $container.removeClass('mobile-nav-on');
    });
  })(jQuery);