Rails 4 Blog engine using SimplyStored as CouchDB orm. At the moment it is developed to use together with the cmtool gem, so please read the documentation of this gem first, or try your luck.
A normal Gemfile
now would look like:
gem 'simply_stored', github: 'bterkuile/simply_stored'
gem 'cmtool'
gem 'couch_blog'
You may want to use a custom layout, more fitting together with your
cmtool website.
Therefore implement the following in your
app/controllers/application_controller.rb
to render your custom
created layout at location app/views/layouts/blog.html.slim
class ApplicationController < ActionController::Base
def couch_blog_render
@page = Page.find_by_name('blog') || Page.new(name: 'blog', locale: I18n.locale)
{layout: "blog"}
end
end
To create a custom view, create a file eg:
app/views/couch_blog/posts/index.html.haml
having your custom content:
- for post in @posts
.post
.date
%span.month= post.date.strftime('%b')
%span.day= post.date.day
%span.year= post.date.year
%h2.title= link_to post.title, couch_blog.post_path(post.id, post.title.to_s.downcase.gsub(/[_\W]+/, '-'))
.post-body=raw post.body