In this recipe, you will see how easy it is to install a copy of the official Bootstrap 4 docs. Running a local copy of the official Bootstrap documentation is a great way to experiment with the available Sass variables, as we will see later in this chapter.
Note
Windows users, you need to have Ruby, Jekyll, and Bundler installed. If you already have them on your system, and providing that you have completed the previous recipe, there are just a few more things to do to run the Jekyll docs.
With your console pointing to chapter3/start/recipe3/bootstrap
, run this command: gem install nokogiri -v 1.7.2
. Next, run bundle exec jekyll build
. This command will build your Jekyll site into ./_gh_pages
.
Run cd _gh_pages
, then run jekyll serve --watch
. Open your own local copy of Bootstrap docs at http://127.0.0.1:4000
.
In order to follow this recipe successfully, you should first install Bootstrap 4 via Git. Thus, this recipe assumes that you have a running environment in Cloud9 IDE, and that you have a complete Bootstrap 4 installation as explained in the previous recipe.
- Verify that Ruby is preinstalled, and Jekyll is not:
which ruby; which jekyll
This command will return only the location of Ruby on your VM. Thus, Jekyll needs to be installed.
- To install Jekyll, you need to install Bundler first:
gem install bundler
Now run
bundle install
, which will install Jekyll:
bundle install
Verify that Jekyll is installed:
bundle show jekyll
Serve Bootstrap 4 Jekyll-powered docs on Cloud9 IDE:
bundle exec jekyll serve --host $IP --port $PORT --baseurl ''
Upon running this command, a notification will pop up with a link to preview the running webpage. Click on the link and choose one of the display options:
Click on the link, and your very own copy of the Bootstrap docs will appear: