jekyll-sitemap 0.5.1 → 0.6.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: f026f8fe9011d1fd2618fb41b4a0001c703ee245
4
- data.tar.gz: 04f2fc12e13e2c54c6b26a947c153cf61083380a
3
+ metadata.gz: 1d60832fcf2200f1b281775fd70f65e6771ccc80
4
+ data.tar.gz: f7480fa2583546629192d7f30f65f065d8612be8
5
5
  SHA512:
6
- metadata.gz: cea99d7d379e464d831acab88c61e3dc7ab1e86a2636a0eba54ea758ca1f3573d5cf676ce2d65778e16f026d593cf65466d020d61c881517e3038645503430e1
7
- data.tar.gz: 36f3207dfada71c6fbcb2e835969420cc24c0c689a30a3588c950f7e40d3af6eb12adfc8c888b0cf34f9a3372aa8a64b436f00068f9f0446c9d5c5b6946207c0
6
+ metadata.gz: 7b429f24897b934498d57a41cba03a712d4f7af0477e4e2e94690df1c5208e8e1ceac2ea15ef87d236caae4911f37866b463f1538491ebc2350beeff2b9e3038
7
+ data.tar.gz: 5bd5341beb212f978ca1d82c4928c5b19008de0321b4f031dd7f1c4e8903ae0ad2db3b44d8851477a01faa18a1632ffe2f1e9d9a193c8ca3a8f103c7b6898268
@@ -1,5 +1,18 @@
1
1
  ## HEAD
2
2
 
3
+ ### Minor Enhancements
4
+
5
+ ### Bug Fixes
6
+
7
+ ## 0.6.0 / 2014-09-05
8
+
9
+ ### Minor Enhancements
10
+
11
+ * Include custom collections in the sitemap. (#30)
12
+ * Use `post.last_modified_at` for post `<lastmod>` if available (#37)
13
+
14
+ ## 0.5.1 / 2014-07-31
15
+
3
16
  ### Bug Fixes
4
17
 
5
18
  * Explicitly set sitemap layout to `nil` to avoid warning (#32)
data/README.md CHANGED
@@ -14,6 +14,14 @@ gems:
14
14
  - jekyll-sitemap
15
15
  ```
16
16
 
17
+ If all gem plugins have the same `priority`, they will be executed in the
18
+ order they are required, generally. Thus, if you have other plugins which
19
+ generate content and store that content in `site.pages`, `site.posts`, or
20
+ `site.collections`, be sure to require `jekyll-sitemap` either *after*
21
+ those other gems if you *want* the sitemap to include the generated
22
+ content, or *before* those other gems if you *don't want* the sitemap to
23
+ include the generated content from the gems. (Programming is *hard*.)
24
+
17
25
  ## Developing locally
18
26
 
19
27
  Use `script/bootstrap` to bootstrap your local development environment.
@@ -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.5.1"
6
+ spec.version = "0.6.0"
7
7
  spec.authors = ["GitHub, Inc."]
8
8
  spec.email = "support@github.com"
9
9
  spec.homepage = "https://github.com/jekyll/jekyll-sitemap"
@@ -4,7 +4,11 @@
4
4
  {% for post in site.posts %}{% unless post.sitemap == false %}
5
5
  <url>
6
6
  <loc>{{ site_url }}{{ post.url }}</loc>
7
+ {% if post.last_modified_at %}
8
+ <lastmod>{{ post.last_modified_at | date_to_xmlschema }}</lastmod>
9
+ {% else %}
7
10
  <lastmod>{{ post.date | date_to_xmlschema }}</lastmod>
11
+ {% endif %}
8
12
  <priority>0.8</priority>
9
13
  </url>
10
14
  {% endunless %}{% endfor %}
@@ -16,6 +20,16 @@
16
20
  <priority>{% if post.url == "/" or post.url == "/index.html" %}1.0{% else %}0.7{% endif %}</priority>
17
21
  </url>
18
22
  {% endunless %}{% endfor %}
23
+ {% for collection in site.collections %}{% unless collection.last.output == false %}
24
+ {% for doc in collection.last.docs %}{% unless doc.sitemap == false %}
25
+ <url>
26
+ <loc>{{ site_url }}{{ doc.url | replace:'index.html','' }}</loc>
27
+ <lastmod>{{ site.time | date_to_xmlschema }}</lastmod>
28
+ <changefreq>weekly</changefreq>
29
+ <priority>{% if doc.url == "/" or doc.url == "/index.html" %}1.0{% else %}0.7{% endif %}</priority>
30
+ </url>
31
+ {% endunless %}{% endfor %}
32
+ {% endunless %}{% endfor %}
19
33
  {% for file in site.html_files %}
20
34
  <url>
21
35
  <loc>{{ site_url }}{{ file.path }}</loc>
@@ -0,0 +1,5 @@
1
+ ---
2
+ permalink: /permalink/
3
+ ---
4
+
5
+ # Custom permalink
@@ -0,0 +1,5 @@
1
+ ---
2
+ permalink: /permalink/unique_name.html
3
+ ---
4
+
5
+ # Unique html name
@@ -0,0 +1,4 @@
1
+ ---
2
+ ---
3
+
4
+ This is just a test.
@@ -0,0 +1,4 @@
1
+ ---
2
+ ---
3
+
4
+ This file shouldn't show up in the sitemap.
@@ -5,7 +5,10 @@ describe(Jekyll::JekyllSitemap) do
5
5
  Jekyll.configuration({
6
6
  "source" => source_dir,
7
7
  "destination" => dest_dir,
8
- "url" => "http://example.org"
8
+ "url" => "http://example.org",
9
+ "collections" => { "my_collection" => { "output" => true },
10
+ "other_things" => { "output" => false }
11
+ }
9
12
  })
10
13
  end
11
14
  let(:site) { Jekyll::Site.new(config) }
@@ -37,6 +40,24 @@ describe(Jekyll::JekyllSitemap) do
37
40
  expect(contents).to match /<loc>http:\/\/example\.org\/2013\/12\/12\/dec-the-second\.html<\/loc>/
38
41
  end
39
42
 
43
+ describe "collections" do
44
+ it "puts all the `output:true` into sitemap.xml" do
45
+ expect(contents).to match /<loc>http:\/\/example\.org\/my_collection\/test\.html<\/loc>/
46
+ end
47
+
48
+ it "doesn't put all the `output:false` into sitemap.xml" do
49
+ expect(contents).to_not match /<loc>http:\/\/example\.org\/other_things\/test2\.html<\/loc>/
50
+ end
51
+
52
+ it "remove 'index.html' for directory custom permalinks" do
53
+ expect(contents).to match /<loc>http:\/\/example\.org\/permalink\/<\/loc>/
54
+ end
55
+
56
+ it "doesn't remove filename for non-directory custom permalinks" do
57
+ expect(contents).to match /<loc>http:\/\/example\.org\/permalink\/unique_name\.html<\/loc>/
58
+ end
59
+ end
60
+
40
61
  it "generates the correct date for each of the posts" do
41
62
  expect(contents).to match /<lastmod>2014-03-04T00:00:00(-|\+)\d+:\d+<\/lastmod>/
42
63
  expect(contents).to match /<lastmod>2014-03-02T00:00:00(-|\+)\d+:\d+<\/lastmod>/
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: 0.5.1
4
+ version: 0.6.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: 2014-07-31 00:00:00.000000000 Z
11
+ date: 2014-09-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
@@ -89,6 +89,10 @@ files:
89
89
  - script/release
90
90
  - spec/fixtures/_config.yml
91
91
  - spec/fixtures/_layouts/some_default.html
92
+ - spec/fixtures/_my_collection/custom_permalink.md
93
+ - spec/fixtures/_my_collection/custom_permalink_2.md
94
+ - spec/fixtures/_my_collection/test.html
95
+ - spec/fixtures/_other_things/test2.html
92
96
  - spec/fixtures/_posts/2013-12-12-dec-the-second.md
93
97
  - spec/fixtures/_posts/2014-03-02-march-the-second.md
94
98
  - spec/fixtures/_posts/2014-03-04-march-the-fourth.md
@@ -121,13 +125,17 @@ required_rubygems_version: !ruby/object:Gem::Requirement
121
125
  version: '0'
122
126
  requirements: []
123
127
  rubyforge_project:
124
- rubygems_version: 2.2.2
128
+ rubygems_version: 2.2.0
125
129
  signing_key:
126
130
  specification_version: 4
127
131
  summary: Automatically generate a sitemap.xml for your Jekyll site.
128
132
  test_files:
129
133
  - spec/fixtures/_config.yml
130
134
  - spec/fixtures/_layouts/some_default.html
135
+ - spec/fixtures/_my_collection/custom_permalink.md
136
+ - spec/fixtures/_my_collection/custom_permalink_2.md
137
+ - spec/fixtures/_my_collection/test.html
138
+ - spec/fixtures/_other_things/test2.html
131
139
  - spec/fixtures/_posts/2013-12-12-dec-the-second.md
132
140
  - spec/fixtures/_posts/2014-03-02-march-the-second.md
133
141
  - spec/fixtures/_posts/2014-03-04-march-the-fourth.md