mojombo/jekyll — pull request #1351 by lviggiano (2013-07-25 10:47:18+00:00)
Title: added a bin/serve.sh script to test site locally, so the urls can be absolute in the html

I noticed that the URL http://mojombo.github.com/jekyll doesn't work
This happens because the {{ site.url }} is not set in _config.yml
and consequently most of the resources are resolved with a
relative URL.

The problem is that, if you specify the {{ site.url }} variable
in the _config.yml then the urls become absolute and when you
try to access the site as http://localhost:4000 for local testing
it will point to the production site. So this is why I created
the bin/serve.sh script that works around the problem creating
a temporary configuration called _serve.yml that overrides the
{{ site.url }} to http://localhost:4000

Also I included the CNAME, README and the bin directory in the
exclude list in the _config.yml, since those file are, at
the moment, accessible at http://jekyllrb.com/CNAME and
http://jekyllrb.com/README. And I suppose it is not desirable.