Skip to content

Instantly share code, notes, and snippets.

@greggnakamura
Created June 19, 2015 00:34
Show Gist options
  • Save greggnakamura/95e6325c930124b2d988 to your computer and use it in GitHub Desktop.
Save greggnakamura/95e6325c930124b2d988 to your computer and use it in GitHub Desktop.
Jekyll: Development and Production environments
http://stackoverflow.com/questions/27386169/change-site-url-to-localhost-during-jekyll-local-development
Let's say we have the local site served at http://localhost and the production site served at https://username.github.io/myProject.
We leave the _config.yml with url: https://username.github.io and baseurl: /myProject
We create a new _config_dev.yml with only url: https://localhost and baseurl: ""
Now to test locally :
jekyll build --config _config.yml,_config_dev.yml
or
jekyll build --config _config.yml,_config_dev.yml --watch
When pushed on production, the jekyll build command will use the default _config.yml.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment