jekyll-feed 0.12.1 → 0.13.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 +11 -2
- data/README.md +16 -1
- data/lib/jekyll-feed/feed.xml +5 -1
- data/lib/jekyll-feed/version.rb +1 -1
- data/spec/fixtures/_posts/2014-03-04-march-the-fourth.md +1 -1
- data/spec/fixtures/_posts/2015-08-08-stuck-in-the-middle.html +4 -0
- data/spec/jekyll-feed_spec.rb +62 -12
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 924d2b8683877244a4fb8950637804fc6e20e6dd16a119fef896705ae6d86bda
|
4
|
+
data.tar.gz: efe3bde414b3469f0e4106cab3fb5228e9f88fddeeae32cb61c6a6e7f2d5e706
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2af23e6f677d347c5b079ecdf7e06f43545dfdc49c5c9ed297e829a4de2149dbecdad81117b081040b86b96f23a90e0f9a81de99222603852ab927edb3b727a2
|
7
|
+
data.tar.gz: a977b4eb4316d1bfdb24d456f20c69b1e636511a773881cbed2de5d8d7a8281a744d64db4920a91e9b054ceedbc3417a1c2c1ce3df3ee63d7c4ca4f1825c43c7
|
data/History.markdown
CHANGED
@@ -1,6 +1,15 @@
|
|
1
|
-
## 0.
|
1
|
+
## 0.13.0 / 2019-11-13
|
2
|
+
|
3
|
+
### Minor Enhancements
|
4
|
+
|
5
|
+
* Excerpt only flag (#287)
|
6
|
+
* Add media:content tag (#290)
|
2
7
|
|
3
|
-
|
8
|
+
### Development Fixes
|
9
|
+
|
10
|
+
* test: use categories in post (#249)
|
11
|
+
|
12
|
+
## 0.12.1 / 2019-03-23
|
4
13
|
|
5
14
|
### Bug Fixes
|
6
15
|
|
data/README.md
CHANGED
@@ -31,7 +31,7 @@ The plugin will automatically use any of the following configuration variables,
|
|
31
31
|
|
32
32
|
* `title` or `name` - The title of the site, e.g., "My awesome site"
|
33
33
|
* `description` - A longer description of what your site is about, e.g., "Where I blog about Jekyll and other awesome things"
|
34
|
-
* `url` - The URL to your site, e.g., `
|
34
|
+
* `url` - The URL to your site, e.g., `https://example.com`. If none is provided, the plugin will try to use `site.github.url`.
|
35
35
|
* `author` - Global author information (see below)
|
36
36
|
|
37
37
|
### Already have a feed path?
|
@@ -182,6 +182,21 @@ feed:
|
|
182
182
|
- updates
|
183
183
|
```
|
184
184
|
|
185
|
+
## Excerpt Only flag
|
186
|
+
|
187
|
+
Optional flag `excerpt_only` allows you to exclude post content from the Atom feed. Default value is `false` for backward compatibility.
|
188
|
+
|
189
|
+
When in `config.yml` is `true` than all posts in feed will be without `<content>` tags.
|
190
|
+
|
191
|
+
```yml
|
192
|
+
feed:
|
193
|
+
excerpt_only: true
|
194
|
+
```
|
195
|
+
|
196
|
+
The same flag can be used directly in post file. It will be disable `<content>` tag for selected post.
|
197
|
+
Settings in post file has higher priority than in config file.
|
198
|
+
|
199
|
+
|
185
200
|
## Contributing
|
186
201
|
|
187
202
|
1. Fork it (https://github.com/jekyll/jekyll-feed/fork)
|
data/lib/jekyll-feed/feed.xml
CHANGED
@@ -50,7 +50,10 @@
|
|
50
50
|
<published>{{ post.date | date_to_xmlschema }}</published>
|
51
51
|
<updated>{{ post.last_modified_at | default: post.date | date_to_xmlschema }}</updated>
|
52
52
|
<id>{{ post.id | absolute_url | xml_escape }}</id>
|
53
|
-
|
53
|
+
{% assign excerpt_only = post.feed.excerpt_only | default: site.feed.excerpt_only %}
|
54
|
+
{% unless excerpt_only %}
|
55
|
+
<content type="html" xml:base="{{ post.url | absolute_url | xml_escape }}">{{ post.content | strip | xml_escape }}</content>
|
56
|
+
{% endunless %}
|
54
57
|
|
55
58
|
{% assign post_author = post.author | default: post.authors[0] | default: site.author %}
|
56
59
|
{% assign post_author = site.data.authors[post_author] | default: post_author %}
|
@@ -86,6 +89,7 @@
|
|
86
89
|
{% assign post_image = post_image | absolute_url %}
|
87
90
|
{% endunless %}
|
88
91
|
<media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="{{ post_image | xml_escape }}" />
|
92
|
+
<media:content medium="image" url="{{ post_image | xml_escape }}" xmlns:media="http://search.yahoo.com/mrss/" />
|
89
93
|
{% endif %}
|
90
94
|
</entry>
|
91
95
|
{% endfor %}
|
data/lib/jekyll-feed/version.rb
CHANGED
data/spec/jekyll-feed_spec.rb
CHANGED
@@ -43,7 +43,7 @@ describe(JekyllFeed) do
|
|
43
43
|
end
|
44
44
|
|
45
45
|
it "puts all the posts in the feed.xml file" do
|
46
|
-
expect(contents).to match "http://example.org/updates/2014/03/04/march-the-fourth.html"
|
46
|
+
expect(contents).to match "http://example.org/updates/jekyll/2014/03/04/march-the-fourth.html"
|
47
47
|
expect(contents).to match "http://example.org/news/2014/03/02/march-the-second.html"
|
48
48
|
expect(contents).to match "http://example.org/news/2013/12/12/dec-the-second.html"
|
49
49
|
expect(contents).to match "http://example.org/2015/08/08/stuck-in-the-middle.html"
|
@@ -92,10 +92,22 @@ describe(JekyllFeed) do
|
|
92
92
|
expect(contents).not_to match "Liquid is not rendered."
|
93
93
|
end
|
94
94
|
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
95
|
+
context "images" do
|
96
|
+
let(:image1) { 'http://example.org/image.png' }
|
97
|
+
let(:image2) { 'https://cdn.example.org/absolute.png?h=188&w=250' }
|
98
|
+
let(:image3) { 'http://example.org/object-image.png' }
|
99
|
+
|
100
|
+
it "includes the item image" do
|
101
|
+
expect(contents).to include(%(<media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="#{image1}" />))
|
102
|
+
expect(contents).to include(%(<media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="#{image2}" />))
|
103
|
+
expect(contents).to include(%(<media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="#{image3}" />))
|
104
|
+
end
|
105
|
+
|
106
|
+
it "included media content for mail templates (Mailchimp)" do
|
107
|
+
expect(contents).to include(%(<media:content medium="image" url="#{image1}" xmlns:media="http://search.yahoo.com/mrss/" />))
|
108
|
+
expect(contents).to include(%(<media:content medium="image" url="#{image2}" xmlns:media="http://search.yahoo.com/mrss/" />))
|
109
|
+
expect(contents).to include(%(<media:content medium="image" url="#{image3}" xmlns:media="http://search.yahoo.com/mrss/" />))
|
110
|
+
end
|
99
111
|
end
|
100
112
|
|
101
113
|
context "parsing" do
|
@@ -240,7 +252,7 @@ describe(JekyllFeed) do
|
|
240
252
|
end
|
241
253
|
|
242
254
|
it "correctly adds the baseurl to the posts" do
|
243
|
-
expect(contents).to match "http://example.org/bass/updates/2014/03/04/march-the-fourth.html"
|
255
|
+
expect(contents).to match "http://example.org/bass/updates/jekyll/2014/03/04/march-the-fourth.html"
|
244
256
|
expect(contents).to match "http://example.org/bass/news/2014/03/02/march-the-second.html"
|
245
257
|
expect(contents).to match "http://example.org/bass/news/2013/12/12/dec-the-second.html"
|
246
258
|
end
|
@@ -345,7 +357,7 @@ describe(JekyllFeed) do
|
|
345
357
|
let(:news_feed) { File.read(dest_dir("feed/news.xml")) }
|
346
358
|
|
347
359
|
it "outputs the primary feed" do
|
348
|
-
expect(contents).to match "http://example.org/updates/2014/03/04/march-the-fourth.html"
|
360
|
+
expect(contents).to match "http://example.org/updates/jekyll/2014/03/04/march-the-fourth.html"
|
349
361
|
expect(contents).to match "http://example.org/news/2014/03/02/march-the-second.html"
|
350
362
|
expect(contents).to match "http://example.org/news/2013/12/12/dec-the-second.html"
|
351
363
|
expect(contents).to match "http://example.org/2015/08/08/stuck-in-the-middle.html"
|
@@ -356,7 +368,7 @@ describe(JekyllFeed) do
|
|
356
368
|
expect(news_feed).to match '<title type="html">My awesome site | News</title>'
|
357
369
|
expect(news_feed).to match "http://example.org/news/2014/03/02/march-the-second.html"
|
358
370
|
expect(news_feed).to match "http://example.org/news/2013/12/12/dec-the-second.html"
|
359
|
-
expect(news_feed).to_not match "http://example.org/updates/2014/03/04/march-the-fourth.html"
|
371
|
+
expect(news_feed).to_not match "http://example.org/updates/jekyll/2014/03/04/march-the-fourth.html"
|
360
372
|
expect(news_feed).to_not match "http://example.org/2015/08/08/stuck-in-the-middle.html"
|
361
373
|
end
|
362
374
|
end
|
@@ -376,7 +388,7 @@ describe(JekyllFeed) do
|
|
376
388
|
let(:news_feed) { File.read(dest_dir("feed/news.xml")) }
|
377
389
|
|
378
390
|
it "outputs the primary feed" do
|
379
|
-
expect(contents).to match "http://example.org/updates/2014/03/04/march-the-fourth.html"
|
391
|
+
expect(contents).to match "http://example.org/updates/jekyll/2014/03/04/march-the-fourth.html"
|
380
392
|
expect(contents).to match "http://example.org/news/2014/03/02/march-the-second.html"
|
381
393
|
expect(contents).to match "http://example.org/news/2013/12/12/dec-the-second.html"
|
382
394
|
expect(contents).to match "http://example.org/2015/08/08/stuck-in-the-middle.html"
|
@@ -387,7 +399,7 @@ describe(JekyllFeed) do
|
|
387
399
|
expect(news_feed).to match '<title type="html">My awesome site | News</title>'
|
388
400
|
expect(news_feed).to match "http://example.org/news/2014/03/02/march-the-second.html"
|
389
401
|
expect(news_feed).to match "http://example.org/news/2013/12/12/dec-the-second.html"
|
390
|
-
expect(news_feed).to_not match "http://example.org/updates/2014/03/04/march-the-fourth.html"
|
402
|
+
expect(news_feed).to_not match "http://example.org/updates/jekyll/2014/03/04/march-the-fourth.html"
|
391
403
|
expect(news_feed).to_not match "http://example.org/2015/08/08/stuck-in-the-middle.html"
|
392
404
|
end
|
393
405
|
end
|
@@ -412,7 +424,7 @@ describe(JekyllFeed) do
|
|
412
424
|
expect(collection_feed).to match '<title type="html">My awesome site | Collection</title>'
|
413
425
|
expect(collection_feed).to match "http://example.org/collection/2018-01-01-collection-doc.html"
|
414
426
|
expect(collection_feed).to match "http://example.org/collection/2018-01-02-collection-category-doc.html"
|
415
|
-
expect(collection_feed).to_not match "http://example.org/updates/2014/03/04/march-the-fourth.html"
|
427
|
+
expect(collection_feed).to_not match "http://example.org/updates/jekyll/2014/03/04/march-the-fourth.html"
|
416
428
|
expect(collection_feed).to_not match "http://example.org/2015/08/08/stuck-in-the-middle.html"
|
417
429
|
end
|
418
430
|
end
|
@@ -440,7 +452,7 @@ describe(JekyllFeed) do
|
|
440
452
|
expect(news_feed).to match '<title type="html">My awesome site | Collection | News</title>'
|
441
453
|
expect(news_feed).to match "http://example.org/collection/2018-01-02-collection-category-doc.html"
|
442
454
|
expect(news_feed).to_not match "http://example.org/collection/2018-01-01-collection-doc.html"
|
443
|
-
expect(news_feed).to_not match "http://example.org/updates/2014/03/04/march-the-fourth.html"
|
455
|
+
expect(news_feed).to_not match "http://example.org/updates/jekyll/2014/03/04/march-the-fourth.html"
|
444
456
|
expect(news_feed).to_not match "http://example.org/2015/08/08/stuck-in-the-middle.html"
|
445
457
|
end
|
446
458
|
end
|
@@ -471,4 +483,42 @@ describe(JekyllFeed) do
|
|
471
483
|
end
|
472
484
|
end
|
473
485
|
end
|
486
|
+
|
487
|
+
context "excerpt_only flag" do
|
488
|
+
context "backward compatibility for no excerpt_only flag" do
|
489
|
+
it "should be in contents" do
|
490
|
+
expect(contents).to match '<content '
|
491
|
+
end
|
492
|
+
end
|
493
|
+
|
494
|
+
context "when site.excerpt_only flag is true" do
|
495
|
+
let(:overrides) do
|
496
|
+
{ "feed" => { "excerpt_only" => true } }
|
497
|
+
end
|
498
|
+
|
499
|
+
it "should not set any contents" do
|
500
|
+
expect(contents).to_not match '<content '
|
501
|
+
end
|
502
|
+
end
|
503
|
+
|
504
|
+
context "when site.excerpt_only flag is false" do
|
505
|
+
let(:overrides) do
|
506
|
+
{ "feed" => { "excerpt_only" => false } }
|
507
|
+
end
|
508
|
+
|
509
|
+
it "should be in contents" do
|
510
|
+
expect(contents).to match '<content '
|
511
|
+
end
|
512
|
+
end
|
513
|
+
|
514
|
+
context "when post.excerpt_only flag is true" do
|
515
|
+
let(:overrides) do
|
516
|
+
{ "feed" => { "excerpt_only" => false } }
|
517
|
+
end
|
518
|
+
|
519
|
+
it "should not be in contents" do
|
520
|
+
expect(contents).to_not match "This content should not be in feed.</content>"
|
521
|
+
end
|
522
|
+
end
|
523
|
+
end
|
474
524
|
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.
|
4
|
+
version: 0.13.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: 2019-
|
11
|
+
date: 2019-11-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|
@@ -187,7 +187,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
187
187
|
- !ruby/object:Gem::Version
|
188
188
|
version: '0'
|
189
189
|
requirements: []
|
190
|
-
rubygems_version: 3.0.
|
190
|
+
rubygems_version: 3.0.6
|
191
191
|
signing_key:
|
192
192
|
specification_version: 4
|
193
193
|
summary: A Jekyll plugin to generate an Atom feed of your Jekyll posts
|