jekyll-feed 0.15.1 → 0.17.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/History.markdown +35 -1
- data/README.md +16 -4
- data/lib/jekyll-feed/feed.xml +5 -4
- data/lib/jekyll-feed/generator.rb +11 -2
- data/lib/jekyll-feed/meta-tag.rb +12 -25
- data/lib/jekyll-feed/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 218e5f581b3f29f0f04eb49800c27b61cecb2ec769882ef2aa00008db2d6bd1a
|
4
|
+
data.tar.gz: b3f1ed32d77b488d45c5fcea9540224d2d340660b37db61958b4cd24d37e3bcc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2b6f1f23ae300ac0caad7a2123e73fb0ea403a9481a1bf71c90b07a166e91c4f64576d48606c960452e431fc1d26cb1531a6649dd622ad0d9c80722edc2a8d3c
|
7
|
+
data.tar.gz: de139bea2ba933414be45fcc6a4fe9e8e7431e8b7ea0bccc2df365121748e4bf07cd9020968670889c84688cc080ce22dc576b1d3936b8c34c07f7eabac727c5
|
data/History.markdown
CHANGED
@@ -1,4 +1,38 @@
|
|
1
|
-
##
|
1
|
+
## 0.17.0 / 2022-10-14
|
2
|
+
|
3
|
+
### Documentation
|
4
|
+
|
5
|
+
* Update CI status badge (#363)
|
6
|
+
|
7
|
+
### Development Fixes
|
8
|
+
|
9
|
+
* Add Ruby 3.1 to the CI matrix (#365)
|
10
|
+
|
11
|
+
### Minor Enhancements
|
12
|
+
|
13
|
+
* Allow disabling of jekyll-feed while in development (#370)
|
14
|
+
|
15
|
+
## 0.16.0 / 2022-01-03
|
16
|
+
|
17
|
+
### Minor Enhancements
|
18
|
+
|
19
|
+
* Add support for `page.description` in front matter to become entry `<summary>` (#297)
|
20
|
+
|
21
|
+
### Bug Fixes
|
22
|
+
|
23
|
+
* Fold private methods into the `:render` method as local variables (#327)
|
24
|
+
* Check `post.categories` instead of `post.category` (#357)
|
25
|
+
* Switched xml_escape for `<![CDATA[]]>` for post content (#332)
|
26
|
+
|
27
|
+
### Development Fixes
|
28
|
+
|
29
|
+
* Add Ruby 3.0 to CI (#337)
|
30
|
+
* Lock RuboCop to v1.18.x (#348)
|
31
|
+
* Add workflow to release gem via GH Action (#355)
|
32
|
+
|
33
|
+
### Documentation
|
34
|
+
|
35
|
+
* Use `.atom` extension in documented examples since we write an Atom feed (#359)
|
2
36
|
|
3
37
|
## 0.15.1 / 2020-10-04
|
4
38
|
|
data/README.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
A Jekyll plugin to generate an Atom (RSS-like) feed of your Jekyll posts
|
4
4
|
|
5
|
-
[![
|
5
|
+
[![Continuous Integration](https://github.com/jekyll/jekyll-feed/actions/workflows/ruby.yml/badge.svg)](https://github.com/jekyll/jekyll-feed/actions/workflows/ruby.yml) [![Gem Version](https://badge.fury.io/rb/jekyll-feed.svg)](https://badge.fury.io/rb/jekyll-feed)
|
6
6
|
|
7
7
|
## Installation
|
8
8
|
|
@@ -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
|
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.
|
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.
|
190
|
+
path: "/changes.atom"
|
189
191
|
categories:
|
190
192
|
- news
|
191
193
|
- updates
|
@@ -244,6 +246,16 @@ feed:
|
|
244
246
|
|
245
247
|
Note that if you include a tag that is excluded a feed will not be generated for it.
|
246
248
|
|
249
|
+
## Skip development
|
250
|
+
|
251
|
+
Use `disable_in_development: true` if you want to turn off feed generation when `jekyll.environment == "development"`,
|
252
|
+
but don't want to remove the plugin (so you don't accidentally commit the removal). Default value is `false`.
|
253
|
+
|
254
|
+
```yml
|
255
|
+
feed:
|
256
|
+
disable_in_development: true
|
257
|
+
```
|
258
|
+
|
247
259
|
## Contributing
|
248
260
|
|
249
261
|
1. Fork it (https://github.com/jekyll/jekyll-feed/fork)
|
data/lib/jekyll-feed/feed.xml
CHANGED
@@ -45,7 +45,7 @@
|
|
45
45
|
{% assign posts = site[page.collection] %}
|
46
46
|
{% endif %}
|
47
47
|
{% if page.category %}
|
48
|
-
{% assign posts = posts | where: "
|
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 }}"
|
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
|
-
{%
|
98
|
-
|
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 %}
|
@@ -8,6 +8,10 @@ module JekyllFeed
|
|
8
8
|
# Main plugin action, called by Jekyll-core
|
9
9
|
def generate(site)
|
10
10
|
@site = site
|
11
|
+
if disabled_in_development?
|
12
|
+
Jekyll.logger.info "Jekyll Feed:", "Skipping feed generation in development"
|
13
|
+
return
|
14
|
+
end
|
11
15
|
collections.each do |name, meta|
|
12
16
|
Jekyll.logger.info "Jekyll Feed:", "Generating feed for #{name}"
|
13
17
|
(meta["categories"] + [nil]).each do |category|
|
@@ -54,9 +58,10 @@ module JekyllFeed
|
|
54
58
|
def collections
|
55
59
|
return @collections if defined?(@collections)
|
56
60
|
|
57
|
-
@collections =
|
61
|
+
@collections = case config["collections"]
|
62
|
+
when Array
|
58
63
|
config["collections"].map { |c| [c, {}] }.to_h
|
59
|
-
|
64
|
+
when Hash
|
60
65
|
config["collections"]
|
61
66
|
else
|
62
67
|
{}
|
@@ -136,5 +141,9 @@ module JekyllFeed
|
|
136
141
|
config["path"] ||= hash["posts"]["path"]
|
137
142
|
hash
|
138
143
|
end
|
144
|
+
|
145
|
+
def disabled_in_development?
|
146
|
+
config && config["disable_in_development"] && Jekyll.env == "development"
|
147
|
+
end
|
139
148
|
end
|
140
149
|
end
|
data/lib/jekyll-feed/meta-tag.rb
CHANGED
@@ -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
|
-
|
24
|
-
|
25
|
-
|
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
|
-
|
33
|
-
|
34
|
-
|
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
|
-
|
37
|
-
|
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
|
data/lib/jekyll-feed/version.rb
CHANGED
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.
|
4
|
+
version: 0.17.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben Balter
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-10-15 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:
|
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:
|
102
|
+
version: 0.12.0
|
103
103
|
- !ruby/object:Gem::Dependency
|
104
104
|
name: typhoeus
|
105
105
|
requirement: !ruby/object:Gem::Requirement
|
@@ -151,14 +151,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
151
151
|
requirements:
|
152
152
|
- - ">="
|
153
153
|
- !ruby/object:Gem::Version
|
154
|
-
version: 2.
|
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.
|
161
|
+
rubygems_version: 3.3.7
|
162
162
|
signing_key:
|
163
163
|
specification_version: 4
|
164
164
|
summary: A Jekyll plugin to generate an Atom feed of your Jekyll posts
|