jekyll-sitemap 0.11.0 → 0.12.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f132cc4e250a79b3f479249b8d069d1f390bfd8a
4
- data.tar.gz: d6762c431548f94b50bae4b3856ad1c83b8088fd
3
+ metadata.gz: c389f3b3fb31f59c71861d1db7fb3ead58b6cd55
4
+ data.tar.gz: 71d6f86a78f5b2f403ac9119953af38eb05bc8bf
5
5
  SHA512:
6
- metadata.gz: e6120fae9a6609421b111f579c5e476d3cdf08417ab6e804d12633ed4cba5ca8f13b84fbb612359107bb659472234c89d88979fa2d869dc51e4315267e5a199d
7
- data.tar.gz: d68e7445917f84a6c0f16d26cb259d74fd2b8158a05754c8214d826df5e5b24eb7abc22817aa831ca7e591ba29867ebf58930b978de285f7a04da7b71277b292
6
+ metadata.gz: 3cedbd8b869f0905b9b6cf6b8a8fe2961b4b2e7191d44cd68539c7d4742a38d75f689cc19007d8cdc548c6c19bc9b9579bdbcfc049756541f7948dee6b046fc2
7
+ data.tar.gz: 3d9c5ce959997df32df9ccaadd28a3be44dca64cd4c0f3f06b99589f83c0265572e6ed3af161b8ab0b0413eeaebece48f5c7311bae8e9220b25b6d849aacbfca
@@ -8,14 +8,11 @@ rvm:
8
8
  matrix:
9
9
  include:
10
10
  - # GitHub Pages
11
- rvm: 2.1.1
12
- env: JEKYLL_VERSION=2.4.0
13
- - rvm: 1.9.3
14
- env: JEKYLL_VERSION=2.5
11
+ rvm: 2.3.1
12
+ env: JEKYLL_VERSION=3.3.0
15
13
  env:
16
14
  matrix:
17
- - JEKYLL_VERSION=2.5
18
- - JEKYLL_VERSION=3.0
15
+ - JEKYLL_VERSION=3.3
19
16
  branches:
20
17
  only:
21
18
  - master
@@ -1,3 +1,15 @@
1
+ ## 0.12.0 / 2016-10-06
2
+
3
+ ### Minor Enhancements
4
+
5
+ * Don't set @site.config["time"] on sitemap generation (#131)
6
+ * Use filters to clean up Liquid template (#128)
7
+
8
+ ### Development Fixes
9
+
10
+ * Appease Rubocop (#132)
11
+ * Drop Addressable dependency (#133)
12
+
1
13
  ## 0.11.0 / 2016-07-08
2
14
 
3
15
  * Add Rubocop (#100)
@@ -3,7 +3,7 @@
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 = "0.11.0"
6
+ spec.version = "0.12.0"
7
7
  spec.authors = ["GitHub, Inc."]
8
8
  spec.email = "support@github.com"
9
9
  spec.homepage = "https://github.com/jekyll/jekyll-sitemap"
@@ -14,9 +14,8 @@ 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_runtime_dependency "addressable", "~>2.4.0"
17
+ spec.add_dependency "jekyll", "~> 3.3"
18
18
 
19
- spec.add_development_dependency "jekyll", ">= 2.0"
20
19
  spec.add_development_dependency "jekyll-last-modified-at", "0.3.4"
21
20
  spec.add_development_dependency "rspec", "~> 3.0"
22
21
  spec.add_development_dependency "rake"
@@ -1,3 +1,2 @@
1
- require 'jekyll/sitemap_filters'
2
- require 'jekyll/page_without_a_file'
3
- require 'jekyll/jekyll-sitemap'
1
+ require "jekyll/page_without_a_file"
2
+ require "jekyll/jekyll-sitemap"
@@ -1,4 +1,4 @@
1
- require 'fileutils'
1
+ require "fileutils"
2
2
 
3
3
  module Jekyll
4
4
  class JekyllSitemap < Jekyll::Generator
@@ -8,7 +8,6 @@ module Jekyll
8
8
  # Main plugin action, called by Jekyll-core
9
9
  def generate(site)
10
10
  @site = site
11
- @site.config["time"] = Time.new
12
11
  unless sitemap_exists?
13
12
  write
14
13
  @site.keep_files ||= []
@@ -45,7 +44,7 @@ module Jekyll
45
44
  # copy sitemap template from source to destination
46
45
  def write
47
46
  FileUtils.mkdir_p File.dirname(destination_path)
48
- File.open(destination_path, 'w') { |f| f.write(sitemap_content) }
47
+ File.open(destination_path, "w") { |f| f.write(sitemap_content) }
49
48
  end
50
49
 
51
50
  def sitemap_content
@@ -54,7 +53,7 @@ module Jekyll
54
53
  site_map.data["layout"] = nil
55
54
  site_map.data["static_files"] = static_files.map(&:to_liquid)
56
55
  site_map.render({}, @site.site_payload)
57
- site_map.output.gsub(/\s{2,}/, "\n")
56
+ site_map.output.gsub(%r!\s{2,}!, "\n")
58
57
  end
59
58
 
60
59
  # Checks if a sitemap already exists in the site source
@@ -1,19 +1,14 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
  <urlset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd" xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
3
- {% capture site_url %}{% if site.url %}{{ site.url | append: site.baseurl }}{% else %}{{ site.github.url }}{% endif %}{% endcapture %}
4
3
  {% for post in site.posts %}{% unless post.sitemap == false %}
5
4
  <url>
6
- <loc>{{ post.url | prepend: site_url | normalize_url }}</loc>
7
- {% if post.last_modified_at %}
8
- <lastmod>{{ post.last_modified_at | date_to_xmlschema }}</lastmod>
9
- {% else %}
10
- <lastmod>{{ post.date | date_to_xmlschema }}</lastmod>
11
- {% endif %}
5
+ <loc>{{ post.url | absolute_url }}</loc>
6
+ <lastmod>{{ post.last_modified_at | default: post.date | date_to_xmlschema }}</lastmod>
12
7
  </url>
13
8
  {% endunless %}{% endfor %}
14
9
  {% for page in site.html_pages %}{% unless page.sitemap == false %}
15
10
  <url>
16
- <loc>{{ page.url | replace:'/index.html','/' | prepend: site_url | normalize_url }}</loc>
11
+ <loc>{{ page.url | replace:'/index.html','/' | absolute_url }}</loc>
17
12
  {% if page.last_modified_at %}
18
13
  <lastmod>{{ page.last_modified_at | date_to_xmlschema }}</lastmod>
19
14
  {% endif %}
@@ -22,7 +17,7 @@
22
17
  {% for collection in site.collections %}{% unless collection.last.output == false or collection.output == false or collection.label == 'posts' %}
23
18
  {% for doc in collection.last.docs %}{% unless doc.sitemap == false %}
24
19
  <url>
25
- <loc>{{ doc.url | replace:'/index.html','/' | prepend: site_url | normalize_url }}</loc>
20
+ <loc>{{ doc.url | replace:'/index.html','/' | absolute_url }}</loc>
26
21
  {% if doc.last_modified_at %}
27
22
  <lastmod>{{ doc.last_modified_at | date_to_xmlschema }}</lastmod>
28
23
  {% endif %}
@@ -30,7 +25,7 @@
30
25
  {% endunless %}{% endfor %}
31
26
  {% for doc in collection.docs %}{% unless doc.sitemap == false %}
32
27
  <url>
33
- <loc>{{ doc.url | replace:'/index.html','/' | prepend: site_url | normalize_url }}</loc>
28
+ <loc>{{ doc.url | replace:'/index.html','/' | absolute_url }}</loc>
34
29
  {% if doc.last_modified_at %}
35
30
  <lastmod>{{ doc.last_modified_at | date_to_xmlschema }}</lastmod>
36
31
  {% endif %}
@@ -39,7 +34,7 @@
39
34
  {% endunless %}{% endfor %}
40
35
  {% for file in page.static_files %}
41
36
  <url>
42
- <loc>{{ file.path | prepend: site_url | normalize_url }}</loc>
37
+ <loc>{{ file.path | absolute_url }}</loc>
43
38
  <lastmod>{{ file.modified_time | date_to_xmlschema }}</lastmod>
44
39
  </url>
45
40
  {% endfor %}
metadata CHANGED
@@ -1,43 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-sitemap
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.0
4
+ version: 0.12.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: 2016-07-08 00:00:00.000000000 Z
11
+ date: 2016-10-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: addressable
14
+ name: jekyll
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 2.4.0
19
+ version: '3.3'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 2.4.0
27
- - !ruby/object:Gem::Dependency
28
- name: jekyll
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - ">="
32
- - !ruby/object:Gem::Version
33
- version: '2.0'
34
- type: :development
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - ">="
39
- - !ruby/object:Gem::Version
40
- version: '2.0'
26
+ version: '3.3'
41
27
  - !ruby/object:Gem::Dependency
42
28
  name: jekyll-last-modified-at
43
29
  requirement: !ruby/object:Gem::Requirement
@@ -127,7 +113,6 @@ files:
127
113
  - lib/jekyll-sitemap.rb
128
114
  - lib/jekyll/jekyll-sitemap.rb
129
115
  - lib/jekyll/page_without_a_file.rb
130
- - lib/jekyll/sitemap_filters.rb
131
116
  - lib/sitemap.xml
132
117
  - script/bootstrap
133
118
  - script/cibuild
@@ -182,7 +167,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
182
167
  version: '0'
183
168
  requirements: []
184
169
  rubyforge_project:
185
- rubygems_version: 2.4.8
170
+ rubygems_version: 2.6.7
186
171
  signing_key:
187
172
  specification_version: 4
188
173
  summary: Automatically generate a sitemap.xml for your Jekyll site.
@@ -1,10 +0,0 @@
1
- require 'addressable/uri'
2
-
3
- module Jekyll
4
- module SitemapFilters
5
- def normalize_url(input)
6
- Addressable::URI.parse(input).normalize.to_s
7
- end
8
- end
9
- end
10
- Liquid::Template.register_filter(Jekyll::SitemapFilters)