jekyll-sitemap 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -0
- data/History.markdown +7 -0
- data/Rakefile +1 -1
- data/jekyll-sitemap.gemspec +3 -3
- data/lib/sitemap.xml +6 -5
- data/spec/fixtures/404.md +4 -0
- data/spec/fixtures/static_files/404.html +1 -0
- data/spec/jekyll-sitemap_spec.rb +8 -0
- metadata +7 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 897954146a4adc0c9cdadd4c31f9288de94159bc
|
4
|
+
data.tar.gz: 7977f8c2cd010bf15fa9aaa087d8e71cb66f9c30
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 00c473c17dd68f6fb43edffbec8fd092f21fb4f3d01f58432d3b2c72b176d1d7426f61274f8b57269d2f7730b727e43cf20ce7f6998f5278347b577eea2a6135
|
7
|
+
data.tar.gz: d1378177010aa6cf2808d020c10ea7c2c7fed2c27793e900eb3c805dae48cb4f0c305c8fa71d78cb56fdeda8882426a549b9eb5c10110f9e393a572e10a7a1eb
|
data/.travis.yml
CHANGED
data/History.markdown
CHANGED
data/Rakefile
CHANGED
data/jekyll-sitemap.gemspec
CHANGED
@@ -3,15 +3,15 @@
|
|
3
3
|
Gem::Specification.new do |spec|
|
4
4
|
spec.name = "jekyll-sitemap"
|
5
5
|
spec.summary = "Automatically generate a sitemap.xml for your Jekyll site."
|
6
|
-
spec.version = "1.
|
6
|
+
spec.version = "1.1.0"
|
7
7
|
spec.authors = ["GitHub, Inc."]
|
8
8
|
spec.email = "support@github.com"
|
9
9
|
spec.homepage = "https://github.com/jekyll/jekyll-sitemap"
|
10
10
|
spec.licenses = ["MIT"]
|
11
11
|
|
12
12
|
spec.files = `git ls-files -z`.split("\x0")
|
13
|
-
spec.executables = spec.files.grep(%r
|
14
|
-
spec.test_files = spec.files.grep(%r
|
13
|
+
spec.executables = spec.files.grep(%r!^bin/!) { |f| File.basename(f) }
|
14
|
+
spec.test_files = spec.files.grep(%r!^(test|spec|features)/!)
|
15
15
|
spec.require_paths = ["lib"]
|
16
16
|
|
17
17
|
spec.add_dependency "jekyll", "~> 3.3"
|
data/lib/sitemap.xml
CHANGED
@@ -8,7 +8,7 @@
|
|
8
8
|
{% assign docs = collection.docs | where_exp:'doc','doc.sitemap != false' %}
|
9
9
|
{% for doc in docs %}
|
10
10
|
<url>
|
11
|
-
<loc>{{ doc.url | replace:'/index.html','/' | absolute_url }}</loc>
|
11
|
+
<loc>{{ doc.url | replace:'/index.html','/' | absolute_url | xml_escape }}</loc>
|
12
12
|
{% if doc.last_modified_at or doc.date %}
|
13
13
|
<lastmod>{{ doc.last_modified_at | default: doc.date | date_to_xmlschema }}</lastmod>
|
14
14
|
{% endif %}
|
@@ -16,19 +16,20 @@
|
|
16
16
|
{% endfor %}
|
17
17
|
{% endfor %}
|
18
18
|
|
19
|
-
{% assign pages = site.html_pages | where_exp:'doc','doc.sitemap != false' %}
|
19
|
+
{% assign pages = site.html_pages | where_exp:'doc','doc.sitemap != false' | where_exp:'doc','doc.url != "/404.html"' %}
|
20
20
|
{% for page in pages %}
|
21
21
|
<url>
|
22
|
-
<loc>{{ page.url | replace:'/index.html','/' | absolute_url }}</loc>
|
22
|
+
<loc>{{ page.url | replace:'/index.html','/' | absolute_url | xml_escape }}</loc>
|
23
23
|
{% if page.last_modified_at %}
|
24
24
|
<lastmod>{{ page.last_modified_at | date_to_xmlschema }}</lastmod>
|
25
25
|
{% endif %}
|
26
26
|
</url>
|
27
27
|
{% endfor %}
|
28
28
|
|
29
|
-
{%
|
29
|
+
{% assign static_files = page.static_files | where_exp:'page','page.name != "404.html"' %}
|
30
|
+
{% for file in static_files %}
|
30
31
|
<url>
|
31
|
-
<loc>{{ file.path | absolute_url }}</loc>
|
32
|
+
<loc>{{ file.path | absolute_url | xml_escape }}</loc>
|
32
33
|
<lastmod>{{ file.modified_time | date_to_xmlschema }}</lastmod>
|
33
34
|
</url>
|
34
35
|
{% endfor %}
|
@@ -0,0 +1 @@
|
|
1
|
+
404. That's an error.
|
data/spec/jekyll-sitemap_spec.rb
CHANGED
@@ -97,6 +97,10 @@ describe(Jekyll::JekyllSitemap) do
|
|
97
97
|
expect(contents).to match %r!/static_files/test.pdf!
|
98
98
|
end
|
99
99
|
|
100
|
+
it "does not include any static files named 404.html" do
|
101
|
+
expect(contents).not_to match %r!/static_files/404.html!
|
102
|
+
end
|
103
|
+
|
100
104
|
it "does not include posts that have set 'sitemap: false'" do
|
101
105
|
expect(contents).not_to match /\/exclude-this-post\.html<\/loc>/
|
102
106
|
end
|
@@ -105,6 +109,10 @@ describe(Jekyll::JekyllSitemap) do
|
|
105
109
|
expect(contents).not_to match /\/exclude-this-page\.html<\/loc>/
|
106
110
|
end
|
107
111
|
|
112
|
+
it "does not include the 404 page" do
|
113
|
+
expect(contents).not_to match /\/404\.html<\/loc>/
|
114
|
+
end
|
115
|
+
|
108
116
|
it "correctly formats timestamps of static files" do
|
109
117
|
expect(contents).to match /\/this-is-a-subfile\.html<\/loc>\s+<lastmod>\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(-|\+)\d{2}:\d{2}<\/lastmod>/
|
110
118
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-sitemap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- GitHub, Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-04-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|
@@ -119,6 +119,7 @@ files:
|
|
119
119
|
- script/cibuild
|
120
120
|
- script/console
|
121
121
|
- script/release
|
122
|
+
- spec/fixtures/404.md
|
122
123
|
- spec/fixtures/_config.yml
|
123
124
|
- spec/fixtures/_layouts/some_default.html
|
124
125
|
- spec/fixtures/_my_collection/custom_permalink.md
|
@@ -144,6 +145,7 @@ files:
|
|
144
145
|
- spec/fixtures/some-subfolder/this-is-a-subfile.html
|
145
146
|
- spec/fixtures/some-subfolder/this-is-a-subpage.html
|
146
147
|
- spec/fixtures/some-subfolder/xhtml.xhtml
|
148
|
+
- spec/fixtures/static_files/404.html
|
147
149
|
- spec/fixtures/static_files/test.pdf
|
148
150
|
- spec/jekyll-sitemap_spec.rb
|
149
151
|
- spec/spec_helper.rb
|
@@ -168,11 +170,12 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
168
170
|
version: '0'
|
169
171
|
requirements: []
|
170
172
|
rubyforge_project:
|
171
|
-
rubygems_version: 2.
|
173
|
+
rubygems_version: 2.4.5
|
172
174
|
signing_key:
|
173
175
|
specification_version: 4
|
174
176
|
summary: Automatically generate a sitemap.xml for your Jekyll site.
|
175
177
|
test_files:
|
178
|
+
- spec/fixtures/404.md
|
176
179
|
- spec/fixtures/_config.yml
|
177
180
|
- spec/fixtures/_layouts/some_default.html
|
178
181
|
- spec/fixtures/_my_collection/custom_permalink.md
|
@@ -198,6 +201,7 @@ test_files:
|
|
198
201
|
- spec/fixtures/some-subfolder/this-is-a-subfile.html
|
199
202
|
- spec/fixtures/some-subfolder/this-is-a-subpage.html
|
200
203
|
- spec/fixtures/some-subfolder/xhtml.xhtml
|
204
|
+
- spec/fixtures/static_files/404.html
|
201
205
|
- spec/fixtures/static_files/test.pdf
|
202
206
|
- spec/jekyll-sitemap_spec.rb
|
203
207
|
- spec/spec_helper.rb
|