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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d9f1490df61dff96aec336b4fec0c1bf07af59bf3e93d89c5d958ed10d45ae8c
4
- data.tar.gz: 761d4861417c74388be0f32ca3c41d7d8e6eaa286a0cf312931c02d12053c56c
3
+ metadata.gz: 924d2b8683877244a4fb8950637804fc6e20e6dd16a119fef896705ae6d86bda
4
+ data.tar.gz: efe3bde414b3469f0e4106cab3fb5228e9f88fddeeae32cb61c6a6e7f2d5e706
5
5
  SHA512:
6
- metadata.gz: f68fef0919f920712de11bcf73d18f94f02e21aa8927aa271c2a113eb8f3151d7831000bdf7435cbd3ed7b8337ba8c081395ab85bfd6474787ee11f2d60516c5
7
- data.tar.gz: 4d9c93ac791c78c0329356ff15cd2b8a338318484e5ab747a3f1aeedb3004c2758194ee19a7cfb8508a7b62f6309e85e2b6b0dfcca71ad284f52dda554763725
6
+ metadata.gz: 2af23e6f677d347c5b079ecdf7e06f43545dfdc49c5c9ed297e829a4de2149dbecdad81117b081040b86b96f23a90e0f9a81de99222603852ab927edb3b727a2
7
+ data.tar.gz: a977b4eb4316d1bfdb24d456f20c69b1e636511a773881cbed2de5d8d7a8281a744d64db4920a91e9b054ceedbc3417a1c2c1ce3df3ee63d7c4ca4f1825c43c7
@@ -1,6 +1,15 @@
1
- ## 0.12.1 / 2019-03-23
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
- * Release: v0.12.0 (#271)
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., `http://example.com`. If none is provided, the plugin will try to use `site.github.url`.
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)
@@ -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
- <content type="html" xml:base="{{ post.url | absolute_url | xml_escape }}">{{ post.content | strip | xml_escape }}</content>
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 %}
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Jekyll
4
4
  module Feed
5
- VERSION = "0.12.1"
5
+ VERSION = "0.13.0"
6
6
  end
7
7
  end
@@ -3,7 +3,7 @@ tags:
3
3
  - '"/><VADER>'
4
4
  image:
5
5
  path: "/object-image.png"
6
- category: updates
6
+ categories: updates jekyll
7
7
  ---
8
8
 
9
9
  March the fourth!
@@ -1,2 +1,6 @@
1
1
  ---
2
+ feed:
3
+ excerpt_only: true
2
4
  ---
5
+
6
+ This content should not be in feed.
@@ -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
- it "includes the item image" do
96
- expect(contents).to include('<media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://example.org/image.png" />')
97
- expect(contents).to include('<media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://cdn.example.org/absolute.png?h=188&amp;w=250" />')
98
- expect(contents).to include('<media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://example.org/object-image.png" />')
95
+ context "images" do
96
+ let(:image1) { 'http://example.org/image.png' }
97
+ let(:image2) { 'https://cdn.example.org/absolute.png?h=188&amp;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.12.1
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-03-23 00:00:00.000000000 Z
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.3
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