tkh_content 0.1.4 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/CHANGELOG.md CHANGED
@@ -2,6 +2,11 @@
2
2
 
3
3
 
4
4
 
5
+ ## 0.1.5
6
+
7
+ * Added blog RSS feed
8
+
9
+
5
10
  ## 0.1.4
6
11
 
7
12
  * Added pagination to the pages index method.
@@ -2,6 +2,7 @@ class BlogController < ApplicationController
2
2
 
3
3
  def index
4
4
  @posts = Page.for_blog.published.order('published_at desc').paginate(:page => params[:page], :per_page => 20)
5
+ # respond_to
5
6
  render :layout => 'blog'
6
7
  end
7
8
 
@@ -0,0 +1,18 @@
1
+ xml.instruct! :xml, version: "1.0"
2
+ xml.rss version: "2.0" do
3
+ xml.channel do
4
+ xml.title Setting.first.try(:blog_name)
5
+ xml.description Setting.first.try(:blog_tagline)
6
+ xml.link blog_url
7
+
8
+ @posts.each do |post|
9
+ xml.item do
10
+ xml.title post.title
11
+ xml.description post.body
12
+ xml.pubDate post.published_at.to_s(:rfc822)
13
+ xml.link page_url(post)
14
+ xml.guid page_url(post)
15
+ end
16
+ end
17
+ end
18
+ end
@@ -1,3 +1,3 @@
1
1
  module TkhContent
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tkh_content
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -150,6 +150,7 @@ files:
150
150
  - app/controllers/pages_controller.rb
151
151
  - app/models/page.rb
152
152
  - app/views/blog/index.html.erb
153
+ - app/views/blog/index.rss.builder
153
154
  - app/views/pages/_form.html.erb
154
155
  - app/views/pages/edit.html.erb
155
156
  - app/views/pages/index.html.erb
@@ -219,7 +220,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
219
220
  version: '0'
220
221
  segments:
221
222
  - 0
222
- hash: -1172791185126554956
223
+ hash: -4176267993467367485
223
224
  required_rubygems_version: !ruby/object:Gem::Requirement
224
225
  none: false
225
226
  requirements:
@@ -228,7 +229,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
228
229
  version: '0'
229
230
  segments:
230
231
  - 0
231
- hash: -1172791185126554956
232
+ hash: -4176267993467367485
232
233
  requirements: []
233
234
  rubyforge_project:
234
235
  rubygems_version: 1.8.23