This is a guide to install Octopress blogging framework on Mac OS X Mavericks. This was done and tested on OS X Mavericks version 10.9.1. You will need to have a GitHub account with SSH keys properly configured to sucessfully host the Octopress blog on GitHub Pages.
Getting and installing Octopress locally.
1234567
cd ~/
git clone git://github.com/imathis/octopress.git octopress
cd octopress
gem install bundler
bundle install
rake install
cd ~/octopress/
git clone https://github.com/kAworu/octostrap3 .themes/octostrap3
rake 'install[octostrap3]'
Edit _config.yml with your parameters.
1
vi ~/octopress/_config.yml
1
rake generate
Getting ready for deployment to GitHub Pages:
Follow this guide to setup SSH key based authentication to Github: (Reference)
Create a new Github repository and name the repository with the format username.github.io, where username is your GitHub user name.
Github Pages for users uses the master branch like the public directory on a web server, serving the files at your Pages url http://username.github.io. As a result, you’ll want to work on the source for your blog in the source branch and commit the generated content to the master branch. Octopress has a configuration task that helps you set all this up.
Prepare Octopress and deploy to GitHub Pages: (Reference)
12
cd ~/octopress/
rake setup_github_pages
Enter the following where username is your username.
1
git@github.com:username/username.github.io.git
This will generate the blog, copy the generated files into _deploy/, add them to git, commit and push them to the master branch.
NOTE: The content line can cause problems and make the search not working. If this is the case, remove the whole content... line from below. This will make only post titles searchable.
---
layout: page
title: "404 Error"
comments: true
sharing: false
footer: true
---
<p>Sorry, the page you’re looking for cannot be found.</p><p>Please use the search function in the top navigation bar if you’re looking for something specific.</p>
Custom Domain:
1
echo'your-domain.com' >> source/CNAME
Visit your domain registrar or DNS host and add a record for your domain name.
For a sub-domain like www.example.com you would create a CNAME record pointing to username.github.io.
If you are using a top-level domain like example.com, you must use an A record pointing to 204.232.175.78.
Edit the source/_posts/my-new-post.markdown with any text editor.
12
rake generate
rake preview
Open http://localhost:4000 to see a preview of the blog. When satisfied, the previously created, /usr/local/bin/octoupload, script can be executed to automatically commit all changes and upload to GitHub Pages.