Skip to content

How to Build the Website

Zach Whaley edited this page Jul 20, 2018 · 16 revisions

Our website uses Jekyll to build itself, then GitHub Pages Uses the generated site to serve it to the world 😄

Forewarning: Jekyll is only officially supported on Mac and Linux. It should work on Windows, but is not guaranteed.

If you have not downloaded the website code yet, follow these instructions before continuing.

How to Build the Website

Mac

1. Prerequisites

There are a few developer programs you should install on your computer before attempting to build the website.

  1. Homebrew

    Homebrew is a package manager for Mac computers and makes installing these developer programs much easier. To install Homebrew copy and paste the command below into your terminal and press enter.

    /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  2. Build Tools

    There are a few build tools that you will need, and are most likely already installed, so first you should check if you have them. Copy and paste each of the following commands into your open terminal, each command should run and display some numbers, and should not display the text command not found

    Ruby

    ruby -v
    gem -v

    If either of these commands fail, copy and paste the command directly below into your open terminal and wait for the Ruby program to install

    brew install ruby

    GCC and Make

    gcc -v
    g++ -v
    make -v

    If any of those commands fail, copy and paste the command directly below into your open terminal and wait for the GCC and Make programs to install

    xcode-select --install

You should now have everything you need to get started!

2. Installing Jekyll

As mentioned above, our site is built with a program called Jekyll. Before installing Jekyll, you'll need to install a program called Bundler. Bundler is a program to keep track of all the packages needed to build the website.

To install Bundler, open your terminal again, copy and paste the commands below verbatim into your terminal window, and press Enter.

gem install bundler

Next, we'll use Bundler to install the rest of our website's packages.

You'll need to know where in your computer you downloaded the code for this step. I believe the GitHub desktop app can tell you where that is.

Open your terminal again. We are going to use the cd command to Change Directories (go to a different folder) to the directory (folder) where you downloaded the website code. Use the command below as a guide, but replace Documents/gpa-centex.github.io/ with your code's downloaded location.

cd Documents/gpa-centex.github.io/

After completing this command, run the below command.

bundle install

This last command will download all the packages, including Jekyll, required to build the website.

3. Building the Website

Open your terminal again, use the cd command again to change directories to the directory where you downloaded the website code.

Then run the below command

bundle exec jekyll server

Some text will show up in the terminal, and in that text a URL that looks like this http://127.0.0.1:4000/

Copy and paste that URL into a browser and the website should come up!

This is not the real website, but just a copy running locally on your computer.

When you close your terminal, the website will stop running :)

Windows

The Jekyll website provides some documentation for install Jekyll on Windows.

See here

Questions?

Feel free to email the website admin at [email protected]