title: Publishing on Github Pages sidebar: mydoc_sidebar permalink: mydoc_publishing_github_pages.html summary: "You can publish your project on Github Pages, which is a free web hosting service provided by Github. All you need is to put your content into a Github repo branch called gh-pages and make this your default branch in your repo. With a Jekyll site, you just commit your entire project into the gh-pages branch and Github Pages will build the site for you."
which git
.{{end}}git clone https://github.com/tomjoht/myreponame.git
, replacing the https://github.com/tomjoht/myreponame.git
with your repository's https clone URL that you copied.Open the _config.yml file and add the following:
url: tomjoht.github.io
baseurl: /myreponame
Change the url to your github account name, and the baseurl to your repo name.
Bundler is a package manager for Ruby that will install all dependencies you might need to build your site locally. I recommend installing Bundler through homebrew. (Sorry, these instructions apply to Mac only.)
Install homebrew:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Install Bundler:
gem install bundler
bundle init
. This creates a Gemfile and Gemfile.lock in your project.open gemfile
. This opens the gemfile in your default text editor.Add the following in the gemfile (replacing the existing contents):
source 'https://rubygems.org'
gem 'github-pages'
Run bundle install
.
Add the new jekyll files to git: git add --all
.
Commit the files: git commit -m "committing my jekyll theme"
.
Push the files up to your github repo: git push
.
Github Pages will now automatically build your site. Wait a minute or two, and then visit tomjoht.github.io/yourreponame, replacing this path with your github account and branch.
You can also customize your Github URL. More instructions on this later....
{% include links.html %}