middleman-sitemap 0.0.8 → 0.0.9

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: 2bfd8fa43eba63cb17854e0cd135634a5197d6d2
4
- data.tar.gz: e068d59572bb9b269bcf34f0295e1c351b695d52
3
+ metadata.gz: 43062a33c19dde7407fea248e17a4a013f23c09c
4
+ data.tar.gz: af451adf3cf0b0889010d1a5eafb97ceb0f9ba39
5
5
  SHA512:
6
- metadata.gz: 5fd1ebc8e8a4ba3eee0ad8aaa9ebc6310a48a406caded6608ad6a90417c6f3f20366574d3c352cd7acd7ed2cebf4049c4601fd70c3a7bc15f82b5e4eccf4f564
7
- data.tar.gz: fe82d342bb3c79a27466f4af30978f388480841e04bc50ead680c990d8dafb39b886f5ada5c61b2daaa21162bab8ed395407fdf57bfcb2183e90ff1754c16cbf
6
+ metadata.gz: a416323aff24bb4d4cbd8084ca6fec096faf45281e186b949208c076f34da9c9d72c9a602902f8840db674be8f758a1622fd065a06b61e1fde3e597275d5c065
7
+ data.tar.gz: 5000714186f0f55f5627242c73a62a1b581b794a0606bc6b5a8f9a52bc93096a29465d0b336f8a00e1785e26e84a9514a48add4f95459b071c11ba0419fac375
@@ -13,6 +13,35 @@ Feature: Multiple sitemaps for large sites
13
13
  | build/sitemap1.xml |
14
14
  | build/sitemap2.xml |
15
15
 
16
+ @slow @announce
17
+ Scenario: Sitemap index should have proper content
18
+ Given a successfully built app at "large-site-app"
19
+ When I cd to "build"
20
+ Then the file "sitemap.xml" should contain "</sitemapindex>"
21
+ And the file "sitemap.xml" should contain "http://www.example.com/sitemap1.xml.gz"
22
+ And the file "sitemap.xml" should contain "http://www.example.com/sitemap2.xml.gz"
23
+
24
+ @slow @announce
25
+ Scenario: Sitemap index should have proper URLs when GZIP is false
26
+ Given a fixture app "large-site-app"
27
+ And a file named "config.rb" with:
28
+ """
29
+ activate :sitemap, :gzip => false
30
+ """
31
+ And a successfully built app at "large-site-app"
32
+ When I cd to "build"
33
+ Then the file "sitemap.xml" should contain "</sitemapindex>"
34
+ And the file "sitemap.xml" should contain "http://www.example.com/sitemap1.xml"
35
+ And the file "sitemap.xml" should contain "http://www.example.com/sitemap2.xml"
36
+
37
+ @slow @announce
38
+ Scenario: Sitemaps should have proper content
39
+ Given a successfully built app at "large-site-app"
40
+ When I cd to "build"
41
+ Then the file "sitemap1.xml" should contain "</urlset>"
42
+ And the file "sitemap1.xml" should contain "http://www.example.com/page00001.html"
43
+ And the file "sitemap2.xml" should contain "http://www.example.com/page50000.html"
44
+
16
45
  Scenario: Small site should have multiple sitemaps
17
46
  Given a successfully built app at "gzip-app"
18
47
  Then the following files should not exist:
@@ -39,6 +39,7 @@ class Sitemap < ::Middleman::Extension
39
39
  def build_sitemap_index(sitemaps)
40
40
  @hostname = options.hostname
41
41
  @sitemaps = sitemaps
42
+ @ext = options.gzip ? ".xml.gz" : ".xml"
42
43
  template = Tilt::ERBTemplate.new(File.expand_path(File.join("#{File.dirname(__FILE__)}", "../../templates/sitemapindex.xml.erb")))
43
44
  sitemap = template.render(self)
44
45
 
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "middleman-sitemap"
6
- s.version = "0.0.8"
6
+ s.version = "0.0.9"
7
7
  s.platform = Gem::Platform::RUBY
8
8
  s.authors = ["Larry Staton Jr."]
9
9
  s.email = ["larry@larrystaton.com"]
@@ -2,7 +2,7 @@
2
2
  <sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
3
3
  <% 1.upto(@sitemaps) do |idx| %>
4
4
  <sitemap>
5
- <loc><%= @hostname %>/sitemap<%= idx %>.xml.gz</loc>
5
+ <loc><%= @hostname %>/sitemap<%= idx %><%= @ext %></loc>
6
6
  <lastmod><%= Date.today.to_time.iso8601 %></lastmod>
7
7
  </sitemap>
8
8
  <% end %>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: middleman-sitemap
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Larry Staton Jr.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-28 00:00:00.000000000 Z
11
+ date: 2014-03-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: middleman-core