Skip to content

Instantly share code, notes, and snippets.

@yulioaj290
Last active March 24, 2019 19:18
Show Gist options
  • Save yulioaj290/2511c4c36fbca0b999ba95ea76a920d2 to your computer and use it in GitHub Desktop.
Save yulioaj290/2511c4c36fbca0b999ba95ea76a920d2 to your computer and use it in GitHub Desktop.
Read Bootstrap Docs offline with Jekyll server and Compile Bootstrap Docs for static reading from a local server with Apache2 or Xampp

Read Bootstrap Docs offline with Jekyll server

Requirements

Project Bootstrap use many tools (tools) such as SASS, Jekyll, NPM, Bundler, etc.

  1. Install Git
$ sudo apt-get install git
  1. Install Ruby
$ sudo apt-get install ruby-full
  1. Install NodeJS
$ sudo apt-get install nodejs
  1. Install SASS
sudo gem install sass
  1. Install Bundler
sudo gem install bundler

1. Clone the Bootstrap repository

$ git clone --depth 1 https://github.com/twbs/bootstrap.git
$ cd bootstrap

2. Install all required Gems

$ sudo bundle install

3. Install all required NPM dependencies

$ npm install

4. Run Jekyll server

$ npm run docs-serve

or

$ bundle exec jekyll serve

When the server is fully loaded, usually it will run on the http://localhost:9001 url, however you should review the message from the terminal to be sure about the correct url.

Compile Bootstrap Docs for static reading from a local server with Apache2 or Xampp

Requirements

Follow all previous steps to prepare the environment.

1. Edit the baseurl

Open the file _config.yml located on the root of the Bootstrap folder, and change the baseurl parameter with the final url to use on the local server, Eg: http://localhost/doc/bs4

2. Compile Bootstrap Docs

$ npm run docs-compile

This command will compile all files from markdown to HTML.

The result of his output can be viewed in the directory _gh_pages.

3. Deploy static HTML files compiled

Copy all HTML compiled files to final folder in local server, Eg: /var/www/html/doc/bs4.

Now you can access to static Bootstrap Docs from http://localhost/doc/bs4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment