middleman-sitemap 0.0.10 → 0.0.11

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: b98332b873efea3e949e8cd9c1813babdd432e1d
4
- data.tar.gz: 4b28ccd1a50cb372a3de224f68caac7225cf72a2
3
+ metadata.gz: b6aec1a24ba9b08938486a49d644a42b2d72e4e4
4
+ data.tar.gz: ed96ebaa0ab1ef92c70ee3d0d347cd10d95b5c2d
5
5
  SHA512:
6
- metadata.gz: c0a6a2456459cec088e1078aeb4cb5749ee758a7255a7d7ff983ea66115cd815197bc911b999de4438c2ad82e496343d74d9fc84e9bcec7354ac5ee56cf44ed1
7
- data.tar.gz: f0d97be34463134e78ebfa67a344061da4b8dfd0ec0354914af73912ec2e92584b8394df06fa378d7df65ee03e334dc3af843042b73c684948242251c07ed63e
6
+ metadata.gz: 3059dfa28a7cf0e66c102f88cb2345f73e70621b877fb052509f6b2e717fd0047c50d5e5ae86e8832facb9c16ee1d078a7a9a02466d6d45a2e5f529d5e2678d0
7
+ data.tar.gz: e0d81cc050cfa275040b2096daa6a278ac3fa8939f7b7d307141449f3d870ddfed8cc164693b228ee6eb30970efdbb2ec88baa032e5dcd9263336e8fd2f430f7
@@ -4,3 +4,8 @@ Feature: Encode HTML entities
4
4
  Given a successfully built app at "weird-urls-app"
5
5
  When I cd to "build"
6
6
  Then the file "sitemap.xml" should contain "http://www.example.com/this-&-that"
7
+
8
+ Scenario: Subdirectories
9
+ Given a successfully built app at "subdirectories-app"
10
+ When I cd to "build"
11
+ Then the file "sitemap.xml" should contain "http://www.example.com/error-pages/404.html"
@@ -13,7 +13,7 @@ Feature: Multiple sitemaps for large sites
13
13
  | build/sitemap1.xml |
14
14
  | build/sitemap2.xml |
15
15
 
16
- @slow @announce
16
+ @slow
17
17
  Scenario: Sitemap index should have proper content
18
18
  Given a successfully built app at "large-site-app"
19
19
  When I cd to "build"
@@ -21,7 +21,7 @@ Feature: Multiple sitemaps for large sites
21
21
  And the file "sitemap.xml" should contain "http://www.example.com/sitemap1.xml.gz"
22
22
  And the file "sitemap.xml" should contain "http://www.example.com/sitemap2.xml.gz"
23
23
 
24
- @slow @announce
24
+ @slow
25
25
  Scenario: Sitemap index should have proper URLs when GZIP is false
26
26
  Given a fixture app "large-site-app"
27
27
  And a file named "config.rb" with:
@@ -34,7 +34,7 @@ Feature: Multiple sitemaps for large sites
34
34
  And the file "sitemap.xml" should contain "http://www.example.com/sitemap1.xml"
35
35
  And the file "sitemap.xml" should contain "http://www.example.com/sitemap2.xml"
36
36
 
37
- @slow @announce
37
+ @slow
38
38
  Scenario: Sitemaps should have proper content
39
39
  Given a successfully built app at "large-site-app"
40
40
  When I cd to "build"
@@ -0,0 +1 @@
1
+ activate :sitemap
File without changes
@@ -0,0 +1,5 @@
1
+ ---
2
+ priority: 0.8
3
+ changefreq: monthly
4
+ ---
5
+ this & that
@@ -89,14 +89,9 @@ class Sitemap < ::Middleman::Extension
89
89
  end
90
90
 
91
91
  # Returns a URL with proper HTML entities
92
- def urlencode(url)
93
- purl = URI.parse(url)
94
- path_match = purl.path.match(/\/([^.]+)/)
95
- if path_match
96
- escaped_path = app.escape_html(path_match[1])
97
- purl.path = "/#{escaped_path}.html"
98
- end
99
- return purl.to_s
92
+ def encode(path)
93
+ str = path.split("/").map { |f| app.escape_html(f) }.join("/")
94
+ return "#{str}.html"
100
95
  end
101
96
 
102
97
  end
@@ -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.10"
6
+ s.version = "0.0.11"
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
  <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
3
3
  <% @pages.each do |p| %>
4
4
  <url>
5
- <loc><%= urlencode(@hostname + p.url).gsub(/\/$/,'') %></loc>
5
+ <loc><%= @hostname + encode(p.url).gsub(/\/$/,'') %></loc>
6
6
  <lastmod><%= Date.today.to_time.iso8601 %></lastmod>
7
7
  <changefreq><%= p.data.changefreq || 'weekly' %></changefreq>
8
8
  <priority><%= p.data.priority || '0.5' %></priority>
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.10
4
+ version: 0.0.11
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-30 00:00:00.000000000 Z
11
+ date: 2014-04-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: middleman-core
@@ -51047,6 +51047,12 @@ files:
51047
51047
  - fixtures/large-site-app/source/page50999.html
51048
51048
  - fixtures/large-site-app/source/page51000.html
51049
51049
  - fixtures/large-site-app/source/stylesheets/test.css
51050
+ - fixtures/subdirectories-app/config.rb
51051
+ - fixtures/subdirectories-app/source/error-pages/404.html
51052
+ - fixtures/subdirectories-app/source/index.html
51053
+ - fixtures/subdirectories-app/source/javascripts/test.js
51054
+ - fixtures/subdirectories-app/source/stylesheets/test.css
51055
+ - fixtures/subdirectories-app/source/this-&-that.html
51050
51056
  - fixtures/weird-urls-app/config.rb
51051
51057
  - fixtures/weird-urls-app/source/index.html
51052
51058
  - fixtures/weird-urls-app/source/javascripts/test.js