Jekyll's configuration

Aug 1, 2014

Base configuration for prod and dev

If you want to install Jekyll, see documentation on Jekyll website, and code on Jekyll’s GitHub repo.

Configuration differs between development and production platforms. We then need to have two different config files.

The production setup is in _config.yml and the development setup, in _config_dev.yml, with this minimum content :

baseurl: "/jekyll/doc/_site"
url: ""

Note: baseurl is very important to set, more than url. This because, it’s used to reach assets (css, js, images) by`prepending it to url.

{{ "/bootstrap/css/style.css" | prepend: site.baseurl }}
"{{ site.baseurl }}/bootstrap/css/style.css"

Then in development environment, we just have to do :

jekyll build --config _config.yml,_config_dev.yml

With watch :

jekyll build --config _config.yml,_config_dev.yml -w

Whe can now build your new Jekyll site on both environments.