This blog is powered by o-blog, which converts Org files into static html pages. As an Emacs + Org user, o-blog is the best blog tool so far to myself. It allows me to use the all the features from Org, at the same time provides a lot of cool features.
Setting up the basic page is relatively straight forward. Let's starts from our "Hello World!" example.
#+TITLE: Hello World Blog #+DESCRIPTION: How to create a basic blog using o-blog #+STARTUP: logdone #+TEMPLATE_DIR: templates #+URL: http://helloworld.blog #+DISQUS: hello-world-demo #+FILENAME_SANITIZER: ob-sanitize-string #+POST_SORTER: ob-sort-posts-by-date * Home Page , :PROPERTIES: , :PAGE: index.html , :TEMPLATE: blog_static_no_title.html , :END: #+begin_o_blog_row 8 #+begin_o_blog_hero_unit #+HTML: <h1><lisp>(ob:blog-title BLOG)</lisp></h1> #+end_o_blog_hero_unit #+o_blog_row_column 4 #+HTML: <div class="hero-unit" style="font-size: 100%;"> ,/icon-github-sign icon-white/ github #+HTML: </div> #+end_o_blog_row #+begin_o_blog_row 5 ** Hello World , Welcome to our =Hello World= demo site. #+end_o_blog_row * Blog Details ** Copyright , :PROPERTIES: , :SNIPPET: t , :END: ** About , :PROPERTIES: , :SNIPPET: t , :END: , =Hello World= demo site using o-blog ** Navigation , :PROPERTIES: , :SNIPPET: t , :END: ** Navigation Footer , :PROPERTIES: , :SNIPPET:t , :END: ** Articles by tags , :PROPERTIES: , :PAGE: tags.html , :TEMPLATE: blog_post-by-tags.html , :END: * Posts ** DONE Hello World :demo:hello_world: , CLOSED: [2012-12-15 Sat 15:35] , :PROPERTIES: , :END: , This is our =Hello World= example by using o-blog. , It's required to insert an empty line between =:END:= and the content , of the post. A post only get published when it's state cycle changed , from =TODO= to =DONE= which is a great feature which allows us to , keep our in-progress post private until it's done.
After this, you can just type M-x org-publish-blog to generate the
static htmls. All outputs will be in out directory. You can just copy
this directory to wherever you host your website, i.e. S3, EC2, or
Github Pages. For S3, you can use a great set of tools from
s3cmd, including s3cmd put, s3cmd sync, or s3cmd setacl. I
use EC2 as my host. What I did at the beginning was setting up a
Mercurial repository on my server. Every time I generate new htmls,
I push to my server. Since I also want to host a mirror site via
Github Page, I switched to use Github as my repository. On my EC2
server, I created a cron job which will git pull every minute.
deploy workflow +--------------+ +------------------+ +--------------+ | | | | | | | | | | (crontab) | | | Laptop | git push | Github | git pull | EC2 Server | | |---------> |wujiang.github.com|---------> |morediff.info | | | | | | | | | | | | | +--------------+ +------------------+ +--------------+