Create a Jekyll blog on GitHub in 12 easy steps
2017-12-05 Simon says ...
Blogging with Jekyll and GitHub Pages is a real pleasure. Write your posts in simple Markdown, push to GitHub, and Bob's your uncle. Setting up a blog and hosting it on GitHub Pages will only cost you 5 minutes of your time. Just follow the steps below.
Jekyll default site (image opens a new tab):
12 easy steps to blogging happiness
The following assumes you have Ruby installed on a Linux machine and that you have registered an account on GitHub.
- Create a new repository on GitHub. In the example below, the repository is called simonsblog. You can simply replace simonsblog with the name of your blog and BreslawScripts with your GitHub username.
- Install Jekyll and the Gem Bundler on your local machine:
gem install jekyll bundler
- Create a folder with your new blog:
jekyll new simonsblog
- Move into the new directory:
- Build your blog and browse to http://localhost:4000 to see a local version:
bundle exec jekyll serve
- In the _ config.yml file in your local folder, replace the line base_url:"" with: `
- Initialise the Git directory:
- Create and switch to a GitHub Pages branch:
git checkout -b gh-pages
- Add your files to Git:
git add .
git commit -m "initial blog commit"
- Link your local folder to the remote repository on GitHub:
git remote add origin https://github.com/BreslawScripts/simonsblog.git
- Push the local files to GitHub:
git push origin gh-pages
Your blog is now online at:
YOUR GITHUB USERNAME.github.io/YOUR BLOG
Add new posts and make changes to the default site layout on your local machine (see the fantastic Jekyll docs). Then, when you're done, update your live blog:
bundle exec jekyll build git add . git commit -m "your commit message" git push origin gh-pages
Automate your commit and push tasks with a Rakefile
See the following blog post on how to automate the commit and push process:
Automate shell commands with a simple Rakefile