caboose-cms 0.9.76 → 0.9.77

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: 609a44de81243d561064f99d93f9f7ff113f5d82
4
- data.tar.gz: c4213dc5352d3fd9bf30e66ba8216035e5ee76c2
3
+ metadata.gz: 4aa7c4f9117cd898e7d0b2762debd2949c55bb55
4
+ data.tar.gz: f6e97205063f9d1cc6eedb2858769eccd77b9611
5
5
  SHA512:
6
- metadata.gz: 58aa3be8111218acdd34d8dfd852589a0108fa2804e7076d6bc4d1dfd1a21d8d15a90f17c1c622c526bb94b379a093cd0c0252fbd78313f98908d6795b021482
7
- data.tar.gz: a962f4a914ef23b7866e53fcca0f31147c9e664360d6bbd99b578e6eebf9bbb471956fc6ad7a74eff20607c471061cd8fadccd2ce45ef38027182183425a47ff
6
+ metadata.gz: 9b700cb00edb349c732367b43c16fe024877b679053a03950811f81c7847227bb8dfa69f97711b2ac70d5d2c46f813abcca671f33617bad35f1420fef359ca8d
7
+ data.tar.gz: bf8a292aa05dff7a726ced9d0b57c5ff092e0ee49ccf51a725b95592f59ff56dc5fc0e62ea16af3fa9914813bfd7321b279bb82d10ec0e6f2380ff718c338bfd
@@ -9,7 +9,14 @@ module Caboose
9
9
  end
10
10
 
11
11
  def sitemap
12
- respond_to :xml
12
+ @protocol = request && request.protocol ? request.protocol : 'http'
13
+ begin
14
+ view = ActionView::Base.new(ActionController::Base.view_paths)
15
+ str = view.render(:partial => "../../app/views/caboose/blocks/#{@site.name}/sitemap", :locals => {:site => @site, :protocol => @protocol})
16
+ render :inline => str
17
+ rescue ActionView::MissingTemplate => ex
18
+ respond_to :xml
19
+ end
13
20
  end
14
21
 
15
22
  def robots
@@ -8,9 +8,69 @@
8
8
  xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9
9
9
  http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
10
10
  <url>
11
- <loc>http://<%= prim %>/</loc>
12
- <changefreq>weekly</changefreq>
11
+ <loc><%= @protocol %><%= prim %></loc>
12
+ <changefreq>daily</changefreq>
13
13
  <priority>1.00</priority>
14
14
  </url>
15
+
16
+ <% pages = Caboose::Page.index_page(@site.id) ? Caboose::Page.index_page(@site.id).children.where(:hide => false).order(:sort_order).all : [] %>
17
+ <% level_2 = [] %>
18
+ <% level_3 = [] %>
19
+ <% level_4 = [] %>
20
+ <% level_5 = [] %>
21
+
22
+
23
+ <% pages.each do |p| %>
24
+ <url>
25
+ <loc><%= @protocol %><%= prim %>/<%= p.uri %></loc>
26
+ <changefreq>weekly</changefreq>
27
+ <priority>1.00</priority>
28
+ </url>
29
+ <% p.children.where(:hide => false).order(:sort_order).all.each do |s| %>
30
+ <% level_2 << s.uri %>
31
+ <% s.children.where(:hide => false).order(:sort_order).all.each do |s1| %>
32
+ <% level_3 << s1.uri %>
33
+ <% s1.children.where(:hide => false).order(:sort_order).all.each do |s2| %>
34
+ <% level_4 << s2.uri %>
35
+ <% s2.children.where(:hide => false).order(:sort_order).all.each do |s3| %>
36
+ <% level_5 << s3.uri %>
37
+ <% end %>
38
+ <% end %>
39
+ <% end %>
40
+ <% end %>
41
+ <% end %>
42
+
43
+ <% level_2.each do |p| %>
44
+ <url>
45
+ <loc><%= @protocol %><%= prim %>/<%= p %></loc>
46
+ <changefreq>weekly</changefreq>
47
+ <priority>0.8</priority>
48
+ </url>
49
+ <% end %>
50
+
51
+ <% level_3.each do |p| %>
52
+ <url>
53
+ <loc><%= @protocol %><%= prim %>/<%= p %></loc>
54
+ <changefreq>weekly</changefreq>
55
+ <priority>0.7</priority>
56
+ </url>
57
+ <% end %>
58
+
59
+ <% level_4.each do |p| %>
60
+ <url>
61
+ <loc><%= @protocol %><%= prim %>/<%= p %></loc>
62
+ <changefreq>weekly</changefreq>
63
+ <priority>0.6</priority>
64
+ </url>
65
+ <% end %>
66
+
67
+ <% level_5.each do |p| %>
68
+ <url>
69
+ <loc><%= @protocol %><%= prim %>/<%= p %></loc>
70
+ <changefreq>weekly</changefreq>
71
+ <priority>0.5</priority>
72
+ </url>
73
+ <% end %>
74
+
15
75
  </urlset>
16
76
  <% end %>
@@ -1,3 +1,3 @@
1
1
  module Caboose
2
- VERSION = '0.9.76'
2
+ VERSION = '0.9.77'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: caboose-cms
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.76
4
+ version: 0.9.77
5
5
  platform: ruby
6
6
  authors:
7
7
  - William Barry
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-10-05 00:00:00.000000000 Z
11
+ date: 2017-10-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pg