middleman-sitemap 0.0.4 → 0.0.5
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 +6 -0
- data/fixtures/weird-urls-app/config.rb +1 -0
- data/fixtures/weird-urls-app/source/index.html +0 -0
- data/fixtures/weird-urls-app/source/javascripts/test.js +0 -0
- data/fixtures/weird-urls-app/source/stylesheets/test.css +0 -0
- data/fixtures/weird-urls-app/source/this-&-that.html +5 -0
- data/lib/middleman-sitemap.rb +11 -0
- data/middleman-sitemap.gemspec +1 -1
- data/templates/sitemap.xml.erb +1 -1
- metadata +9 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1adc2a991abac1fef9c966deb289f3ebb33fddf5
|
4
|
+
data.tar.gz: a18eb3d7841acc6ed7d9c3efd259050d268d8d65
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5f5f18bb6b07b4c8cefdd626e951bcdc958a5ee8e42ec2774f05f86536f3f73eee4020f549a51c7846f0084e102059cb6de0f3f0fc013008d802e90012fd09e1
|
7
|
+
data.tar.gz: a8d6fa9008700e6779eca688c5db85f512a1d39cd06dcd42fcb0905685eac7a9c3ad998e93aeeb095a7cee19e640f02f2acba5f981f9996ab0770b5d01b6aa18
|
@@ -0,0 +1 @@
|
|
1
|
+
activate :sitemap
|
File without changes
|
File without changes
|
File without changes
|
data/lib/middleman-sitemap.rb
CHANGED
@@ -85,6 +85,17 @@ class Sitemap < ::Middleman::Extension
|
|
85
85
|
end
|
86
86
|
end
|
87
87
|
|
88
|
+
# Returns a URL with proper HTML entities
|
89
|
+
def urlencode(url)
|
90
|
+
purl = URI.parse(url)
|
91
|
+
path_match = purl.path.match(/\/([^.]+)/)
|
92
|
+
if path_match
|
93
|
+
escaped_path = app.escape_html(path_match[1])
|
94
|
+
purl.path = "/#{escaped_path}.html"
|
95
|
+
end
|
96
|
+
return purl.to_s
|
97
|
+
end
|
98
|
+
|
88
99
|
end
|
89
100
|
|
90
101
|
::Middleman::Extensions.register(:sitemap, Sitemap)
|
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><%= @hostname
|
5
|
+
<loc><%= urlencode(@hostname + 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.5
|
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-03-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: middleman-core
|
@@ -37,6 +37,7 @@ files:
|
|
37
37
|
- LICENSE
|
38
38
|
- README.md
|
39
39
|
- Rakefile
|
40
|
+
- features/encoding.feature
|
40
41
|
- features/gzip.feature
|
41
42
|
- features/multiple_sitemaps.feature
|
42
43
|
- features/support/env.rb
|
@@ -51046,6 +51047,11 @@ files:
|
|
51046
51047
|
- fixtures/large-site-app/source/page50999.html
|
51047
51048
|
- fixtures/large-site-app/source/page51000.html
|
51048
51049
|
- fixtures/large-site-app/source/stylesheets/test.css
|
51050
|
+
- fixtures/weird-urls-app/config.rb
|
51051
|
+
- fixtures/weird-urls-app/source/index.html
|
51052
|
+
- fixtures/weird-urls-app/source/javascripts/test.js
|
51053
|
+
- fixtures/weird-urls-app/source/stylesheets/test.css
|
51054
|
+
- fixtures/weird-urls-app/source/this-&-that.html
|
51049
51055
|
- lib/middleman-sitemap.rb
|
51050
51056
|
- lib/middleman_extension.rb
|
51051
51057
|
- middleman-sitemap.gemspec
|
@@ -51075,6 +51081,7 @@ signing_key:
|
|
51075
51081
|
specification_version: 4
|
51076
51082
|
summary: Builds a sitemap.xml for your site
|
51077
51083
|
test_files:
|
51084
|
+
- features/encoding.feature
|
51078
51085
|
- features/gzip.feature
|
51079
51086
|
- features/multiple_sitemaps.feature
|
51080
51087
|
- features/support/env.rb
|