jekyll-feed 0.15.1 → 0.16.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
  SHA256:
3
- metadata.gz: e8f1fde42e53f27b048363aa57f03f5d51a3f68fbe6af4e0ffb69209b373ffeb
4
- data.tar.gz: aaaa1c370f29527e3806c6753ae76a2fa8297337f0e667f25fd43d05779fcfef
3
+ metadata.gz: 72a8ff146b022b2a1ee373375cc87b7c178a289f1ed1c893abbf4013aa4f0827
4
+ data.tar.gz: 96c50216c2247289a3bded53e6e09afd03bdf3da4a5feaaa595677e510d8d630
5
5
  SHA512:
6
- metadata.gz: 6800a223adf7b8c6ae236d6b9d3e355d4ca31c7d2e67752cfd2cb5b3fe599ddda2d9c6f28a38a7c6d5e648ac67ca585fe6fe2a2e08f38c158a1b6a95ded11fd7
7
- data.tar.gz: a17bf5e936302721494bba9028ccda96ca88a4e229e0b1c88e6abe63f1ee2c60e3992296da05721d30400952fcc0ccafe4a2bd179038553ee57d3c940a1d04e9
6
+ metadata.gz: 362f2a9a0700e4efd215918169d8b7258a3d2f3aa53eaf5c355c6bc1c906c315f678204bc9ee633c34df63d87be58780e886584e15fbae19cc3ec0c34a86c80a
7
+ data.tar.gz: ffae565f488e7434fbe0c5634e9745e60b36267ca6eed2b7815bd3a9beefe8cc037a68f652ab12e173c4dc5756f4385d716009434ee9b414239135691967a5b1
data/History.markdown CHANGED
@@ -1,4 +1,24 @@
1
- ## HEAD
1
+ ## 0.16.0 / 2022-01-03
2
+
3
+ ### Minor Enhancements
4
+
5
+ * Add support for `page.description` in front matter to become entry `<summary>` (#297)
6
+
7
+ ### Bug Fixes
8
+
9
+ * Fold private methods into the `:render` method as local variables (#327)
10
+ * Check `post.categories` instead of `post.category` (#357)
11
+ * Switched xml_escape for `<![CDATA[]]>` for post content (#332)
12
+
13
+ ### Development Fixes
14
+
15
+ * Add Ruby 3.0 to CI (#337)
16
+ * Lock RuboCop to v1.18.x (#348)
17
+ * Add workflow to release gem via GH Action (#355)
18
+
19
+ ### Documentation
20
+
21
+ * Use `.atom` extension in documented examples since we write an Atom feed (#359)
2
22
 
3
23
  ## 0.15.1 / 2020-10-04
4
24
 
data/README.md CHANGED
@@ -40,7 +40,7 @@ Do you already have an existing feed someplace other than `/feed.xml`, but are o
40
40
 
41
41
  ```yml
42
42
  feed:
43
- path: atom.xml
43
+ path: /blog/feed.atom
44
44
  ```
45
45
 
46
46
  To note, you shouldn't have to do this unless you already have a feed you're using, and you can't or wish not to redirect existing subscribers.
@@ -62,6 +62,8 @@ Additionally, the plugin will use the following values, if present in a post's Y
62
62
 
63
63
  * `author` - The author of the post, e.g., "Dr. Jekyll". If none is given, feed readers will look to the feed author as defined in `_config.yml`. Like the feed author, this can also be an object or a reference to an author in `_data/authors.yml` (see below).
64
64
 
65
+ * `description` - A short description of the post.
66
+
65
67
  ### Author information
66
68
 
67
69
  *TL;DR: In most cases, put `author: [your name]` in the document's front matter, for sites with multiple authors. If you need something more complicated, read on.*
@@ -176,7 +178,7 @@ By default, collection feeds will be outputted to `/feed/<COLLECTION>.xml`. If y
176
178
  feed:
177
179
  collections:
178
180
  changes:
179
- path: "/changes.xml"
181
+ path: "/changes.atom"
180
182
  ```
181
183
 
182
184
  Finally, collections can also have category feeds which are outputted as `/feed/<COLLECTION>/<CATEGORY>.xml`. Specify categories like so:
@@ -185,7 +187,7 @@ Finally, collections can also have category feeds which are outputted as `/feed/
185
187
  feed:
186
188
  collections:
187
189
  changes:
188
- path: "/changes.xml"
190
+ path: "/changes.atom"
189
191
  categories:
190
192
  - news
191
193
  - updates
@@ -45,7 +45,7 @@
45
45
  {% assign posts = site[page.collection] %}
46
46
  {% endif %}
47
47
  {% if page.category %}
48
- {% assign posts = posts | where: "category", page.category %}
48
+ {% assign posts = posts | where: "categories", page.category %}
49
49
  {% endif %}
50
50
  {% unless site.show_drafts %}
51
51
  {% assign posts = posts | where_exp: "post", "post.draft != true" %}
@@ -63,7 +63,7 @@
63
63
  <id>{{ post.id | absolute_url | xml_escape }}</id>
64
64
  {% assign excerpt_only = post.feed.excerpt_only | default: site.feed.excerpt_only %}
65
65
  {% unless excerpt_only %}
66
- <content type="html" xml:base="{{ post.url | absolute_url | xml_escape }}">{{ post.content | strip | xml_escape }}</content>
66
+ <content type="html" xml:base="{{ post.url | absolute_url | xml_escape }}"><![CDATA[{{ post.content | strip }}]]></content>
67
67
  {% endunless %}
68
68
 
69
69
  {% assign post_author = post.author | default: post.authors[0] | default: site.author %}
@@ -94,8 +94,9 @@
94
94
  <category term="{{ tag | xml_escape }}" />
95
95
  {% endfor %}
96
96
 
97
- {% if post.excerpt and post.excerpt != empty %}
98
- <summary type="html">{{ post.excerpt | strip_html | normalize_whitespace | xml_escape }}</summary>
97
+ {% assign post_summary = post.description | default: post.excerpt %}
98
+ {% if post_summary and post_summary != empty %}
99
+ <summary type="html"><![CDATA[{{ post_summary | strip_html | normalize_whitespace }}]]></summary>
99
100
  {% endif %}
100
101
 
101
102
  {% assign post_image = post.image.path | default: post.image %}
@@ -54,9 +54,10 @@ module JekyllFeed
54
54
  def collections
55
55
  return @collections if defined?(@collections)
56
56
 
57
- @collections = if config["collections"].is_a?(Array)
57
+ @collections = case config["collections"]
58
+ when Array
58
59
  config["collections"].map { |c| [c, {}] }.to_h
59
- elsif config["collections"].is_a?(Hash)
60
+ when Hash
60
61
  config["collections"]
61
62
  else
62
63
  {}
@@ -6,35 +6,22 @@ module JekyllFeed
6
6
  include Jekyll::Filters::URLFilters
7
7
 
8
8
  def render(context)
9
+ # Jekyll::Filters::URLFilters requires `@context` to be set in the environment.
9
10
  @context = context
10
- attrs = attributes.map do |k, v|
11
- v = v.to_s unless v.respond_to?(:encode)
12
- %(#{k}=#{v.encode(:xml => :attr)})
13
- end
14
- "<link #{attrs.join(" ")} />"
15
- end
16
-
17
- private
18
-
19
- def config
20
- @config ||= @context.registers[:site].config
21
- end
22
11
 
23
- def attributes
24
- {
25
- :type => "application/atom+xml",
26
- :rel => "alternate",
27
- :href => absolute_url(path),
28
- :title => title,
29
- }.keep_if { |_, v| v }
30
- end
12
+ config = context.registers[:site].config
13
+ path = config.dig("feed", "path") || "feed.xml"
14
+ title = config["title"] || config["name"]
31
15
 
32
- def path
33
- config.dig("feed", "path") || "feed.xml"
34
- end
16
+ attributes = {
17
+ :type => "application/atom+xml",
18
+ :rel => "alternate",
19
+ :href => absolute_url(path),
20
+ }
21
+ attributes[:title] = title if title
35
22
 
36
- def title
37
- config["title"] || config["name"]
23
+ attrs = attributes.map { |k, v| "#{k}=#{v.to_s.encode(:xml => :attr)}" }.join(" ")
24
+ "<link #{attrs} />"
38
25
  end
39
26
  end
40
27
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Jekyll
4
4
  module Feed
5
- VERSION = "0.15.1"
5
+ VERSION = "0.16.0"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-feed
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.1
4
+ version: 0.16.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Balter
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-10-04 00:00:00.000000000 Z
11
+ date: 2022-01-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
@@ -92,14 +92,14 @@ dependencies:
92
92
  requirements:
93
93
  - - "~>"
94
94
  - !ruby/object:Gem::Version
95
- version: '0.5'
95
+ version: 0.12.0
96
96
  type: :development
97
97
  prerelease: false
98
98
  version_requirements: !ruby/object:Gem::Requirement
99
99
  requirements:
100
100
  - - "~>"
101
101
  - !ruby/object:Gem::Version
102
- version: '0.5'
102
+ version: 0.12.0
103
103
  - !ruby/object:Gem::Dependency
104
104
  name: typhoeus
105
105
  requirement: !ruby/object:Gem::Requirement
@@ -120,7 +120,7 @@ dependencies:
120
120
  - - "<"
121
121
  - !ruby/object:Gem::Version
122
122
  version: '2.0'
123
- description:
123
+ description:
124
124
  email:
125
125
  - ben.balter@github.com
126
126
  executables: []
@@ -143,7 +143,7 @@ homepage: https://github.com/jekyll/jekyll-feed
143
143
  licenses:
144
144
  - MIT
145
145
  metadata: {}
146
- post_install_message:
146
+ post_install_message:
147
147
  rdoc_options: []
148
148
  require_paths:
149
149
  - lib
@@ -151,15 +151,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
151
151
  requirements:
152
152
  - - ">="
153
153
  - !ruby/object:Gem::Version
154
- version: 2.4.0
154
+ version: 2.5.0
155
155
  required_rubygems_version: !ruby/object:Gem::Requirement
156
156
  requirements:
157
157
  - - ">="
158
158
  - !ruby/object:Gem::Version
159
159
  version: '0'
160
160
  requirements: []
161
- rubygems_version: 3.0.3
162
- signing_key:
161
+ rubygems_version: 3.1.6
162
+ signing_key:
163
163
  specification_version: 4
164
164
  summary: A Jekyll plugin to generate an Atom feed of your Jekyll posts
165
165
  test_files: []