Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

personal tech blog and portfolio

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 app
Octocat-spinner-32 articles
Octocat-spinner-32 config
Octocat-spinner-32 db
Octocat-spinner-32 lib
Octocat-spinner-32 log
Octocat-spinner-32 public
Octocat-spinner-32 script
Octocat-spinner-32 test
Octocat-spinner-32 vendor
Octocat-spinner-32 .gitignore
Octocat-spinner-32 .travis.yml
Octocat-spinner-32 .yardopts
Octocat-spinner-32 Gemfile
Octocat-spinner-32 Gemfile.lock
Octocat-spinner-32 Procfile
Octocat-spinner-32 README.md
Octocat-spinner-32 Rakefile
Octocat-spinner-32 config.ru
README.md

whatcodecraves.com

Build Status

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

Overview

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.

Permalinks

The canonical permalink format is:

/articles/YYYY/MM/DD/some-dasherized-title

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.

Assets

Post assets served from public.

Usage

There are utility rake tasks to manage posts and publishing:

rake articles:new      # write a new draft
rake articles:pending  # see pending unpublished drafts

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

Development

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

Documentation

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

Deployment

Staging lives on heroku.

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:

sudo service apache2 restart

TODO

  • server-side syntax highlighting - done clientside w/ js right now
  • code overflow scroll
  • helpers for linking to other articles
  • gemify to separate code from content
  • custom heroku buildpack
Something went wrong with that request. Please try again.