Build Status

This is the content and Rails app that serves whatcodecraves.com. Posts are written in markdown and stored in the posts folder.


An article is a folder with a markdown document named index.text. When an article is requested, it is rendered as html with the layout, and cached. Cache expiration is based on file modification timestamps.

The canonical permalink format is:


This will be matched against possible post paths. If a post cannot be found, a 404 will be shown.

Legacy urls are 301 redirected by DeprecatedRoutes middleware.


Post assets served from public.


There are utility rake tasks to manage posts and publishing:

sh rake util:crawl # list all urls in site with status and referer


sh git clone https://github.com/jch/whatcodecraves.com bundle cp config/env.sample .env # customize this rake yard foreman start


Reference documentation can be found at http://rubydoc.info/github/jch/whatcodecraves.com.


Staging lives on heroku.

sh rake deploy # runs everything under `deploy` rake deploy:warmup # warm up Rack::Cache by crawling the site rake deploy:sitemap # generate a sitemap

Apache Passenger configuration on VPS:

# /etc/apache2/conf.d/passenger LoadModule passenger_module /usr/local/rvm/gems/ruby-1.9.2-p180/gems/passenger-3.0.13/ext/apache2/mod_passenger.so PassengerRoot /usr/local/rvm/gems/ruby-1.9.2-p180/gems/passenger-3.0.13 PassengerRuby /usr/local/rvm/wrappers/ruby-1.9.2-p180/ruby

To reload:

sh sudo service apache2 restart


  • server-side syntax highlighting - done clientside w/ js right now
  • code overflow scroll
  • helpers for linking to other posts
  • gemify to separate code from content
  • custom heroku buildpack