buttercms 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8fe5c385b9495ca5cf605b492da7c919691b9e38
4
- data.tar.gz: 4a46cedaaa012e4eafb23b5113339f102891fd98
3
+ metadata.gz: a982631a9e6a1eca796107fd7936215df64e7899
4
+ data.tar.gz: 17720c376778e94c49b3aada430c34fb6b86223f
5
5
  SHA512:
6
- metadata.gz: cfbe6e7b9e6b80a9281e8d6d77cc8838a4923443a849c8f5c4866fe1a3c0419ef738e365826914ba766552cc84c222b9487a9869a35eeebc17a4c104ee51d7c8
7
- data.tar.gz: 749ab9ddd5b55494dbd27f2e6e694c5d138861a70cdfb3b753d74dfd6e3d0c1b0281dbc78881554ee548018b9bee268287285a81ad37977a4f626a4df071a3a4
6
+ metadata.gz: ef4afaa023947fa991dbd53abc2bd8e0a2259223a01a6125bb3f28f77ffd63b16033e2405a2e840134ad94241a9eed90513e6e1d07755f8bd2b9085893d2a8a9
7
+ data.tar.gz: 93c1bd769c5caaa9b39348febd5d4fc981d6cfb5708f91ca3feaebe97dd8a54bc8843a81e9e41e451287ee915f56e14db00cabf46461110c3f233c7e2db8f08e
data/README.rst CHANGED
@@ -13,12 +13,15 @@ Butter provides a user friendly blogging UI, hosted on buttercms.com, and expose
13
13
  This package provides a Rails Engine that interacts with the Butter API to get you up and running in seconds.
14
14
 
15
15
 
16
- Feeds
16
+ Sitemap + Feeds
17
17
  =====================
18
- Your new blog comes built-in with a RSS + Atom feeds for maximum SEO benefit. You can use these to syndicate your content to social networks, RSS readers and more.
18
+ 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.
19
19
 
20
- RSS: http://localhost:3000/blog/rss/
21
- Atom: http://localhost:3000/blog/atom/
20
+ Sitemap: http://localhost:3000/blog/sitemap.xml (named route :blog_sitemap)
21
+
22
+ RSS: http://localhost:3000/blog/rss/ (named route :blog_rss)
23
+
24
+ Atom: http://localhost:3000/blog/atom/ (named route :blog_atom)
22
25
 
23
26
 
24
27
  ============
@@ -126,23 +126,20 @@ module Buttercms
126
126
  end
127
127
 
128
128
 
129
- def feed
130
-
129
+ def butter_feed
131
130
  response = make_butter_request("#{API_URL}posts/")
132
131
  response_json = JSON.parse(response)
133
132
  @recent_posts = response_json['results']
134
-
135
133
  respond_to do |format|
136
134
  format.rss { render layout: false }
137
135
  format.atom { render layout: false }
138
136
  end
137
+ end
139
138
 
140
- # respond_to do |format|
141
- # format.atom { render :layout => false }
142
-
143
- # # we want the RSS feed to redirect permanently to the ATOM feed
144
- # format.rss { redirect_to feed_path(:format => :atom), :status => :moved_permanently }
145
- # end
139
+ def butter_sitemap
140
+ response = make_butter_request("#{API_URL}sitemap/")
141
+ response_json = JSON.parse(response)
142
+ @recent_posts = response_json
146
143
  end
147
144
 
148
145
  end
@@ -0,0 +1,13 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <urlset
3
+ xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
4
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5
+ xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9
6
+ http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
7
+
8
+ <% @recent_posts.each do |post| %>
9
+ <url>
10
+ <loc><%= post['url'] %></loc>
11
+ </url>
12
+ <% end %>
13
+ </urlset>
@@ -17,5 +17,4 @@ xml.rss :version => '2.0', 'xmlns:atom' => 'http://www.w3.org/2005/Atom' do
17
17
  end
18
18
  end
19
19
  end
20
-
21
20
  end
@@ -2,8 +2,10 @@ Buttercms::Engine.routes.draw do
2
2
  get '/' => 'blog#butter_home', as: :blog
3
3
 
4
4
  # Feeds
5
- get '/rss/' => 'blog#feed', :format => 'rss', as: :blog_rss
6
- get '/atom/' => 'blog#feed', :format => 'atom', as: :blog_atom
5
+ get '/rss/' => 'blog#butter_feed', :format => 'rss', as: :blog_rss
6
+ get '/atom/' => 'blog#butter_feed', :format => 'atom', as: :blog_atom
7
+ get '/sitemap.xml' => 'blog#butter_sitemap', :format => 'xml', as: :blog_sitemap
8
+
7
9
 
8
10
  get '/page/:page' => 'blog#butter_home', as: :archive
9
11
  get '/author/:author_slug' => 'blog#butter_author', as: :blog_author
@@ -1,3 +1,3 @@
1
1
  module Buttercms
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: buttercms
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - ButterCms
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-07-19 00:00:00.000000000 Z
11
+ date: 2015-07-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -85,6 +85,7 @@ files:
85
85
  - app/assets/stylesheets/buttercms/application.css
86
86
  - app/controllers/buttercms/blog_controller.rb
87
87
  - app/helpers/buttercms/application_helper.rb
88
+ - app/views/buttercms/blog/butter_sitemap.xml.erb
88
89
  - app/views/buttercms/blog/feed.atom.builder
89
90
  - app/views/buttercms/blog/feed.rss.builder
90
91
  - app/views/layouts/buttercms/application.html.erb