<commit_before>Spud Blog
========

Spud Blog is a Blog Engine designed to be robust, easy to use, and light weight.

__NOTE:__ This project is still in its early infancy.

Installation/Usage
------------------

1. In your Gemfile add the following

		gem 'spud_core', :git => "git://github.com/davydotcom/spud_core_admin.git"
		gem 'spud_blog', :git => "git://github.com/davydotcom/spud_blog.git"

2. Run bundle install
3. Copy in database migrations to your new rails project

		bundle exec rake spud_core:install:migrations
		bundle exec rake spud_blog:install:migrations
		rake db:migrate

4. run a rails server instance and point your browser to /spud/admin

Configuration
-------------

Spud Blog current accepts the following configuration options.

	Spud::Blog.configure do |config|
	  config.base_layout = 'blog'
	  config.blog_enabled = true
	  config.news_enabled = true
	  config.blog_path = 'blog'
	  config.news_path = 'news'
	  config.posts_per_page = 5
	end

Customizing Views
-----------------

A number of built-in views have been provided to help you get started with the frontend display. Customzing these views will require you to copy them into your local application, which can be accomplished by using the views generator. 

	rails generate spud:blog:views

__NOTE:__ The built-in views are likely to undergo changes as features are added to the blogging engine. If a new version of Spud Blog does not play nicely with your customized views, try backing up your views to an alternate location and running the views generator again to see what has changed. <commit_msg>custom fields instructions<commit_after>Spud Blog
========

Spud Blog is a Blog Engine designed to be robust, easy to use, and light weight.

__NOTE:__ This project is still in its early infancy.

Installation/Usage
------------------

1. In your Gemfile add the following

		gem 'spud_core', :git => "git://github.com/davydotcom/spud_core_admin.git"
		gem 'spud_blog', :git => "git://github.com/davydotcom/spud_blog.git"

2. Run bundle install
3. Copy in database migrations to your new rails project

		bundle exec rake spud_core:install:migrations
		bundle exec rake spud_blog:install:migrations
		rake db:migrate

4. run a rails server instance and point your browser to /spud/admin

Configuration
-------------

Spud Blog current accepts the following configuration options.

	Spud::Blog.configure do |config|
	  config.base_layout = 'blog'
	  config.blog_enabled = true
	  config.news_enabled = true
	  config.blog_path = 'blog'
	  config.news_path = 'news'
	  config.posts_per_page = 5
	  config.has_custom_fields = true
	end

Customizing Views
-----------------

A number of built-in views have been provided to help you get started with the frontend display. Customzing these views will require you to copy them into your local application, which can be accomplished by using the views generator. 

	rails generate spud:blog:views

__NOTE:__ The built-in views are likely to undergo changes as features are added to the blogging engine. If a new version of Spud Blog does not play nicely with your customized views, try backing up your views to an alternate location and running the views generator again to see what has changed. 

Javascript Driver
-----------------

Spud Blog includes a small, unobtrusive javascript driver that adds functionality to the built-in views. Including the driver is optional, as all client-side views and controllers are designed to work whether you include it or not. 

	<%= javascript_include_tag 'spud/blog' %>

Custom Fields
-------------

You may find that your blog requires a fields that isn't included in the default `spud_post` model. Adding custom fields is easy. 

1. Set `has_custom_fields` to true in your Spud Blog configuration
2. Create a migration adding the necessary column(s) to your database

		class AddCaptionToPosts < ActiveRecord::Migration
		  def change
		    add_column :spud_posts, :caption, :string
		  end
		end

3. Save a view partial at `app/views/spud/admin/posts/_custom_fields.html.erb` with the desired inputs

		<ol>
		  <li>
		    <%= f.label :caption, 'Caption' %>
		    <%= f.text_field :caption %>
		  </li>
		</ol>
{'fraction_non_alphanumeric': 0.09166865600381953, 'fraction_numerical': 0.0031033659584626403, 'mean_word_length': 3.534632034632035, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 14, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3166500', 'n_tokens_mistral': 1243, 'n_tokens_neox': 1150, 'n_words': 520}