For testing purposes, you can host your blog on your local machine. After setting up and making any changes, Jekyll can server the blog to http://localhost:4000. On the command line in the root directory of the project, run:
$ bundle exec jekyll serve
The bundle exec
part is optional, but if you use Bundler, it ensures the gem dependacies are up-to-date. For a quicker Edit-Build-Test loop, use the --draft
option to build articles from the _drafts
directory:
$ bundle exec jekyll serve --draft --detach
Using --detach
puts the process in the background so that the command prompt can be used for something else.
(As of version 2.4, the --watch
option is enabled by default. If, by chance, you have an older version you'll need to add that option so that changes are monitored.)
You can also set the destination directory to a directory on a different web server such as Apache, nginx, or Lighttpd:
$ jekyll build --destination /path/to/web_server/root