Butter CMS for Rails
**Why Butter?**
Butter makes setting up a professional company blog on Rails insanely easy. It’s built for developers to save us from hosting, DB setup, themeing, maintaining yet another Wordpress install. It’s designed to be quickly integrated to an existing Rails project.
Butter provides a user friendly blogging UI, hosted on buttercms.com, and exposes content created via an API.
This package provides a Rails Engine that interacts with the Butter API to get you up and running in seconds.
Sitemap + Feeds
Your new blog comes built-in with a sitemap.xml, RSS + Atom feeds for maximum SEO benefit. You can use these to syndicate your content to social networks, improve search engine indexation, and more.
Sitemap: localhost:3000/blog/sitemap.xml (named route :blog_sitemap)
RSS: localhost:3000/blog/rss/ (named route :blog_rss)
Atom: localhost:3000/blog/atom/ (named route :blog_atom)
Installation
Add buttercms gem to your Gemfile and install it.
- .. code-block
-
ruby
# In Gemfile
gem 'buttercms'
- .. code-block
-
bash
$ gem install buttercms
Now run the Butter install generator. This will setup a ‘butter.rb` initializer, which provides many customization options, and defines a route in `config/routes.rb`. By default, your blog will live at “/blog”.
- .. code-block
-
bash
$ rails g buttercms:install
Grab your API token from buttercms.com/api_token and throw it in ‘config/initializers/butter.rb` or set it on your ENV like so `$ export BUTTER_TOKEN=yourtokenhere“`
That’s it! You’ve now got a blog running natively in your Rails project.
Check it out: localhost:3000/blog
Log into buttercms.com/ to start blogging!
Customizing your blog
Open ‘initializers/butter.rb` to see the full set of options available for customizing your blog.
Specify the Blog Layout
We’ve provided a default layout but we expect you’ll want the blog to appear your branded layout so we’ve made this as simple as defining ‘config.layout` in `initializers/butter.rb`
- .. code
-
ruby
# In initializers/butter.rb
config.layout = "<your_blog_layout>"
Note that an ideal layout simply defines the header and footer for the page and ‘<%= yields %>` the main body. Restart the server and go to localhost:3000/blog and you’ll see your new branded blog!