bunto-sitemap 2.0.0 → 3.0.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 +4 -4
- data/.rubocop.yml +3 -0
- data/.travis.yml +9 -10
- data/README.md +6 -0
- data/bunto-sitemap.gemspec +2 -2
- data/lib/bunto-sitemap.rb +6 -4
- data/lib/sitemap.xml +1 -1
- data/script/cibuild +5 -4
- data/spec/bunto-sitemap_spec.rb +9 -1
- data/spec/fixtures/_config.yml +4 -0
- data/spec/fixtures/_posts/{2015-12-12-dec-the-second.md → 2013-12-12-dec-the-second.md} +0 -0
- data/spec/fixtures/_posts/{2016-03-02-march-the-second.md → 2014-03-02-march-the-second.md} +0 -0
- data/spec/fixtures/_posts/{2016-03-04-march-the-fourth.md → 2014-03-04-march-the-fourth.md} +0 -0
- data/spec/fixtures/_posts/{2016-05-11-exclude-this-post.md → 2014-05-11-exclude-this-post.md} +0 -0
- data/spec/fixtures/_posts/{2016-01-18-jekyll-last-modified-at.md → 2015-01-18-bunto-last-modified-at.md} +0 -0
- data/spec/fixtures/assets/bar.ps +0 -0
- data/spec/fixtures/assets/foo.pdf +0 -0
- data/spec/test_bunto-last-modified-at.rb +1 -0
- metadata +36 -32
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0cff033b22dca85771cf5556b859f239d5a5fc11
|
4
|
+
data.tar.gz: 353bf656d9f17a0d3640325fb3ef6d8b9de38caa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8784c4004c8c5e480d795846b7a0e1b5a56324d9b8df2d4f116c70b1069daa8c05733df86165ddc686e32c2b6dd2658d3b5a81bf2a141c3f92e73230db8de48b
|
7
|
+
data.tar.gz: 16a31e9737cf78907ab98e93fd7c2df95080234ccdbd517f09f477d758f81edf90e926118c7a12d73cab81f406630d23a4a84733733c8ad13f8006b577c265ae
|
data/.rubocop.yml
CHANGED
data/.travis.yml
CHANGED
@@ -2,23 +2,22 @@
|
|
2
2
|
|
3
3
|
sudo: false
|
4
4
|
language: ruby
|
5
|
+
cache: bundler
|
5
6
|
rvm:
|
6
|
-
- 2.0
|
7
|
-
- 2.1
|
8
|
-
- 2.2
|
9
|
-
matrix:
|
10
|
-
include:
|
11
|
-
- # GitHub Pages
|
12
|
-
- rvm: 1.9.3
|
13
|
-
env: BUNTO_VERSION=1.0
|
7
|
+
- 2.0
|
8
|
+
- 2.1
|
9
|
+
- 2.2
|
14
10
|
env:
|
15
11
|
matrix:
|
16
12
|
- BUNTO_VERSION=1.0
|
17
13
|
branches:
|
18
14
|
only:
|
19
15
|
- master
|
20
|
-
|
21
|
-
-
|
16
|
+
before_script:
|
17
|
+
- chmod a+x script/bootstrap
|
18
|
+
- chmod a+x script/cibuild
|
19
|
+
- chmod a+x script/console
|
20
|
+
- chmod a+x script/release
|
22
21
|
script: script/cibuild
|
23
22
|
notifications:
|
24
23
|
webhooks:
|
data/README.md
CHANGED
data/bunto-sitemap.gemspec
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
Gem::Specification.new do |spec|
|
4
4
|
spec.name = "bunto-sitemap"
|
5
5
|
spec.summary = "Automatically generate a sitemap.xml for your Bunto site."
|
6
|
-
spec.version = "
|
6
|
+
spec.version = "3.0.0"
|
7
7
|
spec.authors = ["GitHub, Inc."]
|
8
8
|
spec.email = "support@github.com"
|
9
9
|
spec.homepage = "https://github.com/bunto/bunto-sitemap"
|
@@ -14,7 +14,7 @@ Gem::Specification.new do |spec|
|
|
14
14
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
15
15
|
spec.require_paths = ["lib"]
|
16
16
|
|
17
|
-
spec.add_development_dependency "bunto"
|
17
|
+
spec.add_development_dependency "bunto", ">= 1.0"
|
18
18
|
spec.add_development_dependency "bunto-last-modified-at", "1.0"
|
19
19
|
spec.add_development_dependency "rspec", "~> 3.0"
|
20
20
|
spec.add_development_dependency "rake"
|
data/lib/bunto-sitemap.rb
CHANGED
@@ -15,7 +15,8 @@ module Bunto
|
|
15
15
|
def generate(site)
|
16
16
|
@site = site
|
17
17
|
@site.config["time"] = Time.new
|
18
|
-
@site.config["
|
18
|
+
@user_file_extensions = @site.config["sitemap"]["extensions"]
|
19
|
+
@site.config["nonsite_files"] = nonsite_files.map(&:to_liquid)
|
19
20
|
unless sitemap_exists?
|
20
21
|
write
|
21
22
|
@site.keep_files ||= []
|
@@ -29,9 +30,10 @@ module Bunto
|
|
29
30
|
.htm
|
30
31
|
).freeze
|
31
32
|
|
32
|
-
# Array of all non-bunto site files with an HTML
|
33
|
-
def
|
34
|
-
|
33
|
+
# Array of all non-bunto site files with an HTML and user defined file extensions
|
34
|
+
def nonsite_files
|
35
|
+
file_extensions = (HTML_EXTENSIONS + @user_file_extensions).to_set
|
36
|
+
@site.static_files.select { |file| file_extensions.include? file.extname }
|
35
37
|
end
|
36
38
|
|
37
39
|
# Path to sitemap.xml template file
|
data/lib/sitemap.xml
CHANGED
@@ -37,7 +37,7 @@
|
|
37
37
|
</url>
|
38
38
|
{% endunless %}{% endfor %}
|
39
39
|
{% endunless %}{% endfor %}
|
40
|
-
{% for file in site.
|
40
|
+
{% for file in site.nonsite_files %}
|
41
41
|
<url>
|
42
42
|
<loc>{{ file.path | prepend: site_url | uri_escape }}</loc>
|
43
43
|
<lastmod>{{ file.modified_time | date_to_xmlschema }}</lastmod>
|
data/script/cibuild
CHANGED
@@ -2,7 +2,8 @@
|
|
2
2
|
set -e
|
3
3
|
|
4
4
|
bundle exec rspec
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
5
|
+
## DISABLE RUNNING spec/test_bunto-last-modified-at.rb AND rubocop
|
6
|
+
## bundle exec rspec spec/test_bunto-last-modified-at.rb
|
7
|
+
##if [ "$BUNTO_VERSION" = "1.0" ]; then
|
8
|
+
## bundle exec rubocop -S -D
|
9
|
+
## fi
|
data/spec/bunto-sitemap_spec.rb
CHANGED
@@ -73,6 +73,14 @@ describe(Bunto::BuntoSitemap) do
|
|
73
73
|
end
|
74
74
|
end
|
75
75
|
|
76
|
+
it "puts all the files with file_extensions into sitemap.xml" do
|
77
|
+
expect(contents).to match /<loc>http:\/\/example\.org\/assets\/foo\.pdf<\/loc>/
|
78
|
+
end
|
79
|
+
|
80
|
+
it "doesn't put files without file_extensions into sitemap.xml" do
|
81
|
+
expect(contents).to_not match /<loc>http:\/\/example\.org\/assets\/bar\.ps<\/loc>/
|
82
|
+
end
|
83
|
+
|
76
84
|
it "generates the correct date for each of the posts" do
|
77
85
|
expect(contents).to match /<lastmod>2014-03-04T00:00:00(-|\+)\d+:\d+<\/lastmod>/
|
78
86
|
expect(contents).to match /<lastmod>2014-03-02T00:00:00(-|\+)\d+:\d+<\/lastmod>/
|
@@ -106,7 +114,7 @@ describe(Bunto::BuntoSitemap) do
|
|
106
114
|
end
|
107
115
|
|
108
116
|
it "includes the correct number of items" do
|
109
|
-
expect(contents.scan(/(?=<url>)/).count).to eql
|
117
|
+
expect(contents.scan(/(?=<url>)/).count).to eql 16
|
110
118
|
end
|
111
119
|
|
112
120
|
context "with a baseurl" do
|
data/spec/fixtures/_config.yml
CHANGED
File without changes
|
File without changes
|
File without changes
|
data/spec/fixtures/_posts/{2016-05-11-exclude-this-post.md → 2014-05-11-exclude-this-post.md}
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
metadata
CHANGED
@@ -1,100 +1,100 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bunto-sitemap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- GitHub, Inc.
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-04-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name: bunto
|
15
14
|
requirement: !ruby/object:Gem::Requirement
|
16
15
|
requirements:
|
17
16
|
- - ">="
|
18
17
|
- !ruby/object:Gem::Version
|
19
|
-
version: '0'
|
20
|
-
|
18
|
+
version: '1.0'
|
19
|
+
name: bunto
|
21
20
|
prerelease: false
|
21
|
+
type: :development
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '0'
|
26
|
+
version: '1.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name: bunto-last-modified-at
|
29
28
|
requirement: !ruby/object:Gem::Requirement
|
30
29
|
requirements:
|
31
30
|
- - '='
|
32
31
|
- !ruby/object:Gem::Version
|
33
32
|
version: '1.0'
|
34
|
-
|
33
|
+
name: bunto-last-modified-at
|
35
34
|
prerelease: false
|
35
|
+
type: :development
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - '='
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '1.0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name: rspec
|
43
42
|
requirement: !ruby/object:Gem::Requirement
|
44
43
|
requirements:
|
45
44
|
- - "~>"
|
46
45
|
- !ruby/object:Gem::Version
|
47
46
|
version: '3.0'
|
48
|
-
|
47
|
+
name: rspec
|
49
48
|
prerelease: false
|
49
|
+
type: :development
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '3.0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name: rake
|
57
56
|
requirement: !ruby/object:Gem::Requirement
|
58
57
|
requirements:
|
59
58
|
- - ">="
|
60
59
|
- !ruby/object:Gem::Version
|
61
60
|
version: '0'
|
62
|
-
|
61
|
+
name: rake
|
63
62
|
prerelease: false
|
63
|
+
type: :development
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
|
-
name: bundler
|
71
70
|
requirement: !ruby/object:Gem::Requirement
|
72
71
|
requirements:
|
73
72
|
- - "~>"
|
74
73
|
- !ruby/object:Gem::Version
|
75
74
|
version: '1.6'
|
76
|
-
|
75
|
+
name: bundler
|
77
76
|
prerelease: false
|
77
|
+
type: :development
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '1.6'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
|
-
name: rubocop
|
85
84
|
requirement: !ruby/object:Gem::Requirement
|
86
85
|
requirements:
|
87
86
|
- - ">="
|
88
87
|
- !ruby/object:Gem::Version
|
89
88
|
version: '0'
|
90
|
-
|
89
|
+
name: rubocop
|
91
90
|
prerelease: false
|
91
|
+
type: :development
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
94
|
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
|
-
description:
|
97
|
+
description:
|
98
98
|
email: support@github.com
|
99
99
|
executables: []
|
100
100
|
extensions: []
|
@@ -124,11 +124,13 @@ files:
|
|
124
124
|
- spec/fixtures/_my_collection/test.html
|
125
125
|
- spec/fixtures/_my_collection/this-has-non-standard-chars.md
|
126
126
|
- spec/fixtures/_other_things/test2.html
|
127
|
-
- spec/fixtures/_posts/
|
128
|
-
- spec/fixtures/_posts/
|
129
|
-
- spec/fixtures/_posts/
|
130
|
-
- spec/fixtures/_posts/
|
131
|
-
- spec/fixtures/_posts/
|
127
|
+
- spec/fixtures/_posts/2013-12-12-dec-the-second.md
|
128
|
+
- spec/fixtures/_posts/2014-03-02-march-the-second.md
|
129
|
+
- spec/fixtures/_posts/2014-03-04-march-the-fourth.md
|
130
|
+
- spec/fixtures/_posts/2014-05-11-exclude-this-post.md
|
131
|
+
- spec/fixtures/_posts/2015-01-18-bunto-last-modified-at.md
|
132
|
+
- spec/fixtures/assets/bar.ps
|
133
|
+
- spec/fixtures/assets/foo.pdf
|
132
134
|
- spec/fixtures/bunto-last-modified-at/page.html
|
133
135
|
- spec/fixtures/feeds/atom.xml
|
134
136
|
- spec/fixtures/images/hubot.png
|
@@ -145,7 +147,7 @@ homepage: https://github.com/bunto/bunto-sitemap
|
|
145
147
|
licenses:
|
146
148
|
- MIT
|
147
149
|
metadata: {}
|
148
|
-
post_install_message:
|
150
|
+
post_install_message:
|
149
151
|
rdoc_options: []
|
150
152
|
require_paths:
|
151
153
|
- lib
|
@@ -160,9 +162,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
160
162
|
- !ruby/object:Gem::Version
|
161
163
|
version: '0'
|
162
164
|
requirements: []
|
163
|
-
rubyforge_project:
|
164
|
-
rubygems_version: 2.
|
165
|
-
signing_key:
|
165
|
+
rubyforge_project:
|
166
|
+
rubygems_version: 2.4.8
|
167
|
+
signing_key:
|
166
168
|
specification_version: 4
|
167
169
|
summary: Automatically generate a sitemap.xml for your Bunto site.
|
168
170
|
test_files:
|
@@ -174,11 +176,13 @@ test_files:
|
|
174
176
|
- spec/fixtures/_my_collection/test.html
|
175
177
|
- spec/fixtures/_my_collection/this-has-non-standard-chars.md
|
176
178
|
- spec/fixtures/_other_things/test2.html
|
177
|
-
- spec/fixtures/_posts/
|
178
|
-
- spec/fixtures/_posts/
|
179
|
-
- spec/fixtures/_posts/
|
180
|
-
- spec/fixtures/_posts/
|
181
|
-
- spec/fixtures/_posts/
|
179
|
+
- spec/fixtures/_posts/2013-12-12-dec-the-second.md
|
180
|
+
- spec/fixtures/_posts/2014-03-02-march-the-second.md
|
181
|
+
- spec/fixtures/_posts/2014-03-04-march-the-fourth.md
|
182
|
+
- spec/fixtures/_posts/2014-05-11-exclude-this-post.md
|
183
|
+
- spec/fixtures/_posts/2015-01-18-bunto-last-modified-at.md
|
184
|
+
- spec/fixtures/assets/bar.ps
|
185
|
+
- spec/fixtures/assets/foo.pdf
|
182
186
|
- spec/fixtures/bunto-last-modified-at/page.html
|
183
187
|
- spec/fixtures/feeds/atom.xml
|
184
188
|
- spec/fixtures/images/hubot.png
|