WRITE

gem "write"

WRITE is a mountable Rails engine that gives the ability to use Github gists as a backend store for a customizable blog tool.

Install the gem, mount it somewhere under your Rails site, configure it with the account to use for gists, and you're done. No database needed.

Configuring

You need to tell WRITE which github account to pull posts from. This is what I used on my own blog

Write.config = { 
  :accounts => ["samerbuna"], # You can use multiple accounts
  :layout => "profile", # WRITE will render all views using this main-app layout
  :title => "Samer Buna", # This will appear in each page title
  :tagline => "Hot & Sour Ideations" # The main page title and header text
}

The :layout is where you can control the look and feel of a WRITE-blog

You then need to mount the WRITE engine, for example, under /blog

mount Write::Engine => "/"

I mounted it under "/" with a domain constraint, so that I can have my blog at blog.samer.ps

That's all you need.

Any github gist under a configured account, with the special file "write.md", will be included in the list of posts.

To include the default css (and atom feed discovery link), you need to yield(:head) in your layout

WRITE serves everything from Rails.cache, it hits github only once and then caches everything. If you need to refresh the cached content (without rebooting), you need to enable a login system.

On my blog, I am using this login engine, which gives a quick and easy way to activate a ready devise-omniauth configurations. If you login with the configured github account, WRITE will give you a link to refresh all posts.

You should be able to override the "write_admin?" helper to instruct WRITE about which user is considered admin (I haven't tested that though)

Read about the features I plan to add to WRITE in this blog post

Feedback and help are welcome.