How to Test Jekyll Website Locally
Preview your site and help troubleshoot failed Jekyll builds.
Test Jekyll website just on GitHub Pages is unprofessional and can be dangerous. It’s highly recommend installing Jekyll to preview your site and help troubleshoot failed Jekyll builds.
Requirements
-
Install Ruby:
$ sudo install ruby
-
Install bundler:
$ gem install bundler
-
Update ‘Gemfile’ in project directory:
\$ source 'https://rubygems.org' \$ gem 'github-pages', group: :jekyll_plugins
-
In project directory, update dependencies:
$ bundle install
Run it
-
Navigate to the working directory:
cd blog
-
Run your Jekyll site locally on ‘watch mood’:
\$ bundle exec Jekyll serve --watch
-
Navigate to:
localhost:4000
orhttp://127.0.0.1:4000
If you update something, when you save, it updates automatically.
End
Add your changes and push to the repo on GitHub