View on GitHub


Test Coverage
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  File: Home
    &mdash; Blogit - Add a blog to your Ruby on Rails application

  <link rel="stylesheet" href="css/style.css" type="text/css" charset="utf-8" />

  <link rel="stylesheet" href="css/common.css" type="text/css" charset="utf-8" />

<script type="text/javascript" charset="utf-8">
  hasFrames = window.top.frames.main ? true : false;
  relpath = '';
  framesUrl = "frames.html#!file.Home.html";

  <script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>

  <script type="text/javascript" charset="utf-8" src="js/app.js"></script>

    <div id="header">
      <div id="menu">
    <a href="_index.html">Index</a> &raquo; 
    <span class="title">File: Home</span>

  <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>

      <div id="search">
    <a class="full_list_link" id="class_list_link"
      Class List
    <a class="full_list_link" id="method_list_link"
      Method List
    <a class="full_list_link" id="file_list_link"
      File List
      <div class="clear"></div>

    <iframe id="search_frame"></iframe>

    <div id="content"><div id='filecontents'><p><a href="http://badge.fury.io/rb/blogit"><img src="https://badge.fury.io/rb/blogit.png" alt="Gem Version"></a>
<a href="http://codeclimate.com/github/KatanaCode/blogit/"><img src="https://codeclimate.com/github/KatanaCode/blogit.png" alt="Code Climate"></a>
<a href="http://codeclimate.com/github/KatanaCode/blogit/badges/"><img src="https://d3s6mut3hikguw.cloudfront.net/github/KatanaCode/blogit/badges/coverage.svg" alt="Test Coverage"></a>
<a href="https://gemnasium.com/KatanaCode/blogit"><img src="https://gemnasium.com/KatanaCode/blogit.png" alt="Blogit"></a>
<a href="https://travis-ci.org/KatanaCode/blogit.png"><img src="https://travis-ci.org/KatanaCode/blogit.png" alt="Travis CI"></a></p>

<h1>Blogit - Add a blog to your Rails application in seconds</h1>

<p>Blogit lets you add a blog to your Ruby on Rails application in just a few seconds.</p>

<p>We developed blogit because we found ourselves adding the same features to client apps over and over again. Now blogit handles all of that for us.</p>


<p>Add these to your Gemfile</p>

<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_gem'>gem</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>blogit</span><span class='tstring_end'>&quot;</span></span>
<span class='comment'># Blogit depends on ActsAsTaggableOn
</span><span class='id identifier rubyid_gem'>gem</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>acts-as-taggable-on</span><span class='tstring_end'>&quot;</span></span>

<p>...and run <code>bundle install</code> to install the gem.</p>

<p>Next, run:</p>

<pre class="code bash"><code class="bash"># add an initializer to config/initializers with all of the configuration options
$ rails g blogit:install

# This will add the necessary migrations to your app&#39;s db/migrate directory
rake blogit:install:migrations

# You don&#39;t need to run this again if you&#39;ve already done so
rake acts_as_taggable_on:install:migrations

# This will run any pending migrations
rake db:migrate


<p>then add the following to your routes.rb file:</p>

<pre class="code bash"><code class="bash"># config/routes.rb
mount Blogit::Engine =&gt; &quot;/blog&quot;

<p>Finally, declare which of your models acts as blogger in your app (probably User or Admin) by calling the <code>blogs</code> method in your model.</p>

<pre class="code ruby"><code class="ruby"><span class='kw'>class</span> <span class='const'>User</span> <span class='op'>&lt;</span> <span class='const'>ActiveRecord</span><span class='op'>::</span><span class='const'>Base</span>

  <span class='id identifier rubyid_blogs'>blogs</span>

<span class='kw'>end</span>

<p>Go to <a href="http://localhost:3000/blog">http://localhost:3000/blog</a> and see your marvelous new blog.</p>

<h2>Instant gratification</h2>

<p>We&#39;ve added some rake tasks to make development easier. </p>

<h3>Seed blog posts</h3>

<p>This rake task will add a bunch of blog posts to your DB:</p>

<pre class="code bash"><code class="bash">rake blogit:seed

<p>Make sure you have at least one model defined as a blogger (probably User or Admin)</p>

<h3>CSS Themes</h3>

<p>Too lazy to write your own CSS? Load in one of blogit&#39;s themes.</p>

<pre class="code css"><code class="css">/*
 *= require blogit/themes/[theme-name]

<p>The list of themes currently available:</p>



<p>Running <code>rails g blogit:install</code> will add an initializer file named <code>config/initializers/blogit.rb</code>. Here you can set various configuration options. </p>

<p>Please <span class='object_link'><a href="Blogit/Configuration.html" title="Blogit::Configuration (class)">read the configuration docs</a></span> for a full list of the options available.</p>

<h2>How to</h2>

<p>There&#39;s a ton of stuff you can do with Blogit. Please read the &quot;<a href="file.HowTo.html" title="How To">How To</a>&quot; guide for more information.</p>

<h2>Batteries included</h2>

<p>Blogit provides you with the following features</p>

<li>An XML Sitemap located at <code>/blog/posts.xml</code></li>
<li>An RSS feed located at <code>/blog/posts.rss</code></li>
<li>Internationalization (see the locales files for configurable options)</li>
<li>Share links (Google+, Twitter &amp; Facebook)</li>
<li><a href="http://disqus.com">Disquss Comments</a></li>
<li>Code Syntax Highlighting</li>
<li>CSS Themes</li>

<h2>Features we&#39;ve still to add</h2>

<p>Blogit is still undergoing development. We&#39;re always looking for ways to make it better.</p>

<p>Read the <a href="file.TODOs.html" title="TODOs">TODOs</a> page for a list of the features we&#39;d like to support.</p>

<h2>Upgrading from a previous version?</h2>

<p>If you&#39;re upgrading from a beta version of blogit, please read <a href="http://blogit.katanacode.com/doc/file.Upgrading.html">this upgrade guide</a></p>


<p>If you discover a problem with Blogit, please let us know about it. </p>

<p><strong>Remember</strong> to search the <a href="https://github.com/KatanaCode/blogit/issues">issues list</a> first in case your issue has already been raised
by another Githuber</p>


<p>Want to help make Blogit better?. Please read the <a href="http://blogit.katanacode.com/doc/file.Contributing.html">contribution guidelines</a> for more information on how you can contribute.</p>

<h2>Legal Stuff</h2>

<p>Blogit is realeased under the MIT License.</p>

<p>See <a href="https://github.com/KatanaCode/blogit/blob/master/MIT-LICENSE">LEGAL</a> for full details.</p>


<p>Blogit was developed by <a href="http://katanacode.com">Katana Code</a> with generous contributions from:</p>

<li><a href="https://github.com/jjeb">Juan Esparza</a></li>
<li><a href="https://github.com/philou">Philou</a></li>
<li><a href="https://github.com/stewartmckee">Stewart McKee</a></li>
<li><a href="https://github.com/kassi">Karsten Silkenbäumer</a></li>

<h2>About Katana Code</h2>

<p>Katana Code are <a href="http://katanacode.com/" title="Katana Code">web developers based in Edinburgh, Scotland</a>.</p>

<p>Copyright © 2011 - 2015 <a href="http://katanacode.com">Katana Code Ltd.</a></p>

    <div id="footer">
  Generated on Sat Oct 24 19:04:45 2015 by
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a> (ruby-2.2.0).