Book Image

Bootstrap 4 Cookbook

By : Ajdin Imsirovic
Book Image

Bootstrap 4 Cookbook

By: Ajdin Imsirovic

Overview of this book

Bootstrap, one of the most popular front-end frameworks, is perfectly built to design elegant, powerful, and responsive interfaces for professional-level web pages. It supports responsive design by dynamically adjusting your web page layout. Bootstrap 4 is a major update with many impressive changes that greatly enhance the end results produced by Bootstrap. This cookbook is a collection of great recipes that show you how to use all the latest features of Bootstrap to build compelling UIs. This book is using the most up-to-date version of Bootstrap 4 in all its chapters. First off, you will be shown how you can leverage the latest core features of Bootstrap 4 to create stunning web pages and responsive media. You will gradually move on to extending Bootstrap 4 with the help of plugins to build highly customized and powerful UIs. By the end of this book, you will know how to leverage, extend, and integrate bootstrap to achieve optimal results for your web projects.
Table of Contents (19 chapters)
Title Page
Credits
About the Author
About the Reviewer
www.PacktPub.com
Customer Feedback
Preface

Installing Bootstrap 4 Jekyll-powered docs


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.

Getting ready

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.

How to do it...

  1. 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.

  1. To install Jekyll, you need to install Bundler first:
      gem install bundler
  1. Now run bundle install, which will install Jekyll:

      bundle install
  1. Verify that Jekyll is installed:

      bundle show jekyll
  1. 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:

  1. Click on the link, and your very own copy of the Bootstrap docs will appear: