My blogging engine
3rd edition

This blog is my third try to write blogging engine. First two was really naive because I tried to implement "something like..." (tumblr, blogger). It was wrong way. Keeping something not-geeky (like tumblr) in mind kills true soul of true geeky blogging engine.

Tools

The mix of tools I use to build this blog:

  • git - for versioning and using GutHub as persistence
  • markdown
  • vim - for editing articles
  • railwayjs (express, ejs, bootstrap) (less then 100 lines of code for now)

Benefits

Why not use wordpress or any alternative? I use my own because:

  • it's fastest engine in the world (because it static or generated by node)
  • it's bulletproof. There's nothing to hack. It's not hackable (of course you still can hack github, but it's not my war because I'm not working on GH)
  • it's gave others access for article sources for fixing
  • it's tiny, not overengineered yet

And the last point: because I can use my own, and it will be better than any other engine. For me. At least.

Blogging workflow

My typical blogging workflow:

  1. Type in console railway generate article Title of my idea to get ./db/content/articles/title-of-my-idea.md with some contents in it:
    Title: Title of my idea
    Date: 21 Jun 2012
    Status: draft
    
  2. I write something and add this file to git: git add db/content
  3. I run local server using railway server command
  4. And visit http://localhost:3000/blog/title-of-my-idea
  5. When I finished final tuning I push commits from db/content submodule
  6. Post-receive hook on github triggers POST http://anatoliy.in/update which is just git submodule update --init and got updated site

This flow also allows multiple authors to work on the same blog. And we doesn't need coding for users and permissions management because all of this kindnessly provided by github.

Structure of document

The structure of article is simple: beginning of file is head (pair of key-values separated with colon), after blank line begins post body. First paragraph of post body is introduction (can be printed out in index, or, maybe designed separately). Every key listed in head accessible while rendering template. Every site-wide variable listed in db/content/site.yml file and also accessible in views and layouts.

Customization

Any kind of customizations available. From views/layout to site structure and behavior. When core is 100-lines long it's pretty easy to customize.


Written by Anatoliy Chakkaev at June 21st, 2012
Many thanks to John Smith, John Doe and mansuleman for fixing this article.

English is not Anatoliy's first language. Please help him to fix this article on the GitHub. Learn how.

Share this post if you like it: