Sha256: 68e9365e0fd3cf2565ca71f2fb4923abf7545e506056dfe9e25fea35e60ab44a

Contents?: true

Size: 1.28 KB

Versions: 1

Compression:

Stored size: 1.28 KB

Contents

couch\_blog
==========

[![Build Status](https://secure.travis-ci.org/bterkuile/couch_blog.png)](http://travis-ci.org/bterkuile/couch\_blog)

Rails 4 Blog engine using SimplyStored as CouchDB orm


## Implement

### Gemfile
A normal `Gemfile` now would look like:

```ruby
gem 'simply_stored', github: 'bterkuile/simply_stored'
gem 'cmtool'
gem 'couch_blog'
```

### Custom layout
You may want to use a custom layout, more fitting together with your
[cmtool](https://github.com/bterkuile/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`
```ruby
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
```

### Custom view
To create a custom view, create a file eg:
`app/views/couch_blog/posts/index.htmlhaml`

having your custom content:
```haml
- 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

```

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
couch_blog-0.6.0 README.md