jekyll-sitemap 1.0.0 → 1.1.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1110ef542fab726b7032d52053b68ae90742854f
4
- data.tar.gz: 4bafdb06ce3f32c9245e1d7965cdc78b5d26108d
3
+ metadata.gz: 897954146a4adc0c9cdadd4c31f9288de94159bc
4
+ data.tar.gz: 7977f8c2cd010bf15fa9aaa087d8e71cb66f9c30
5
5
  SHA512:
6
- metadata.gz: dcd77e467aa2586383c36d9b190134f434903f0225fa9c2acd3712936d1c5970ece83ab07c8910249249bf7fc6e74343aac8c6b1bb99b11693516f8896d090cb
7
- data.tar.gz: 711f197dc725f4c81505b837d54ea9a45ccf96ab4ed55d8602c21688d5b157ad13286c51a5916c8416166c9cc5f4dd4ba3cd9e274e89037fc82ba32ffa356d98
6
+ metadata.gz: 00c473c17dd68f6fb43edffbec8fd092f21fb4f3d01f58432d3b2c72b176d1d7426f61274f8b57269d2f7730b727e43cf20ce7f6998f5278347b577eea2a6135
7
+ data.tar.gz: d1378177010aa6cf2808d020c10ea7c2c7fed2c27793e900eb3c805dae48cb4f0c305c8fa71d78cb56fdeda8882426a549b9eb5c10110f9e393a572e10a7a1eb
data/.travis.yml CHANGED
@@ -16,6 +16,7 @@ env:
16
16
  branches:
17
17
  only:
18
18
  - master
19
+ - /^v\d+\.\d+\.\d+/
19
20
  git:
20
21
  depth: 1000
21
22
  install:
data/History.markdown CHANGED
@@ -1,3 +1,10 @@
1
+ ## 1.1.0 / 2017-04-10
2
+
3
+ ### Minor Enhancements
4
+
5
+ * escape& (#162)
6
+ * feat: remove 404 pages from the sitemap. closes #113 (#164)
7
+
1
8
  ## 1.0.0 / 2017-01-06
2
9
 
3
10
  * No new changes
data/Rakefile CHANGED
@@ -1,5 +1,5 @@
1
1
  require "bundler/gem_tasks"
2
- require 'rspec/core/rake_task'
2
+ require "rspec/core/rake_task"
3
3
 
4
4
  RSpec::Core::RakeTask.new(:spec)
5
5
 
@@ -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.0.0"
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{^bin/}) { |f| File.basename(f) }
14
- spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
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
- {% for file in page.static_files %}
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,4 @@
1
+ ---
2
+ ---
3
+
4
+ 404. That's an error.
@@ -0,0 +1 @@
1
+ 404. That's an error.
@@ -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.0.0
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-01-06 00:00:00.000000000 Z
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.6.8
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