middleman-sitemap 0.0.10 → 0.0.11
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.
- checksums.yaml +4 -4
- data/features/encoding.feature +5 -0
- data/features/multiple_sitemaps.feature +3 -3
- data/fixtures/subdirectories-app/config.rb +1 -0
- data/fixtures/subdirectories-app/source/error-pages/404.html +0 -0
- data/fixtures/subdirectories-app/source/index.html +0 -0
- data/fixtures/subdirectories-app/source/javascripts/test.js +0 -0
- data/fixtures/subdirectories-app/source/stylesheets/test.css +0 -0
- data/fixtures/subdirectories-app/source/this-&-that.html +5 -0
- data/lib/middleman-sitemap/extension.rb +3 -8
- data/middleman-sitemap.gemspec +1 -1
- data/templates/sitemap.xml.erb +1 -1
- metadata +8 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b6aec1a24ba9b08938486a49d644a42b2d72e4e4
|
4
|
+
data.tar.gz: ed96ebaa0ab1ef92c70ee3d0d347cd10d95b5c2d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3059dfa28a7cf0e66c102f88cb2345f73e70621b877fb052509f6b2e717fd0047c50d5e5ae86e8832facb9c16ee1d078a7a9a02466d6d45a2e5f529d5e2678d0
|
7
|
+
data.tar.gz: e0d81cc050cfa275040b2096daa6a278ac3fa8939f7b7d307141449f3d870ddfed8cc164693b228ee6eb30970efdbb2ec88baa032e5dcd9263336e8fd2f430f7
|
data/features/encoding.feature
CHANGED
@@ -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
|
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
|
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
|
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
|
File without changes
|
File without changes
|
File without changes
|
@@ -89,14 +89,9 @@ class Sitemap < ::Middleman::Extension
|
|
89
89
|
end
|
90
90
|
|
91
91
|
# Returns a URL with proper HTML entities
|
92
|
-
def
|
93
|
-
|
94
|
-
|
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
|
data/middleman-sitemap.gemspec
CHANGED
data/templates/sitemap.xml.erb
CHANGED
@@ -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><%=
|
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.
|
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
|
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
|