I finally decided to move my static personal site from Google site to Octopress, a static blogging framework built on top of Jekyll. Though I was happy initially with Google site, it is a pain to do few things in it like customizing layout, themes, fonts, etc.
Personally I was looking for the following features in a blogging framework to bake my site quickly. To bake a site or a blog, there are plethora of frameworks out there to choose from. Though I started with Jekyll at first, I decided to go with Octopress for its easy of use.
- ease of creating content like in markdown format
- local copy of the site source
- host in Amazon cloud, Github or such
- customization of
- fonts, etc.
- plugins for
- source code formatting
- mathematical formulas in LaTEX
- search the site
- table of contents on each page (like in Wikipedia)
To get a local site up & running in Octopress:
- Download and Install Octopress, Ruby, Python, Git (watch out of version compatibility)
- Update all ruby gems
- To create a new page
rake new_page[name]. This creates a
[name].mdfile where your enter your content in markdown format.
- To generate static site in html files
- To deploy locally
rake preview. This starts a local server on http://localhost:4000/.
From my feature list above, most of them were in-built in Octopress except displaying math formulas. Octopress uses ‘rdiscount‘ markdown by default which does not support math formulas via MathJax. ‘kramdown‘ markdown supports this by default, but it does not have ‘table of content’ feature.
To get around this, I found a custom version of ‘rdiscount‘. (More details)
The personal site is now baked and working locally. To host it in github, create a repository named like reponame.github.io. Running `rake deploy` from the folder where Octopress is installed, deploys the static site to the Github repo under ‘master‘ branch. Voila, the site is now successfully hosted under http://reponame.github.io.
Now you don’t want to keep your site source locally in case of any disaster. You could check in the source code as well in Github in the same repository created above under a different branch called ‘source‘ by executing the following commands.
$ rake generate $ git add . $ git commit -am "Some comment here." $ git push origin source