When I work on this site I generally run through a quick check to see if the content looks like I want it too. The downside to using Google Analytics, AdSense, and Disqus is that it really slows down the total load time of a page. While it’s not a huge problem when the site is just loading once it’s a little annoying when I’m loading it 10+ times in a row and making small changes.

In order to get around this I can add the following around any code block I only want on my live server (production):

{% if jekyll.environment == 'production' %}
    Production only code 
{% endif %}

The bonus to this is that if you use Github Pages to generate the pages for you it automatically uses the production environment.

If you’re self hosting like me you’ll need to specify the environment when you build the page:

JEKYLL_ENV=production jekyll build

I added this to my deploy script and it’s working well.