Below are instructions for how to set up a local development environment. Useful for when you want to make many changes and test locally before pushing to github.
Here's how to install GIT.
Tell git to download the rht-labs.github.io source:
git clone https://github.com/rht-labs/rht-labs.github.io
cd rht-labs.github.io
You should now have the whole thing, including the README.md file that you are reading right now!
The web site source files are under _docs
, have a look! They are written using markdown (a simpler format than html). When you push to github, it will automatically convert the pages to static html and build the site https://rht-labs.com/
First install Ruby if you don't already have it e.g.
# homebrew - http://brew.sh
brew install ruby
# fedora
dnf install -y ruby
Then install the Ruby Bundler gem, if you don't already have it.
sudo gem install bundler
Manage your ruby environments using rbenv
Install rbenv
:
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
Set in your environment:
# ruby
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init - bash)"
Change your directory to this repository, and install the ruby environment - rbenv
used by this repo's .ruby-version
rbenv install
Next, tell the bundler to install all the gems needed (jekyll, github-pages, etc). They are listed in Gemfile in case you are curious.
bundle install
If you are getting error messages, you may have old versions of some Gems installed. Try updating to the latest using:
bundle update
Congrats! You got the stuff you need. You should now be ready to....
Tell Jekyll to generate the site and serve it up:
jekyll serve
That's it, your local copy of the site should be up and running on http://localhost:4000
Every time you edit a source doc (under _docs) it will update the site automatically.