rams-jekyll-feed 0.13.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +21 -0
  3. data/.rspec +2 -0
  4. data/.rubocop.yml +27 -0
  5. data/.travis.yml +32 -0
  6. data/Gemfile +11 -0
  7. data/History.markdown +165 -0
  8. data/LICENSE.txt +22 -0
  9. data/README.md +206 -0
  10. data/Rakefile +8 -0
  11. data/appveyor.yml +29 -0
  12. data/lib/jekyll-feed.rb +12 -0
  13. data/lib/jekyll-feed/feed.xml +96 -0
  14. data/lib/jekyll-feed/generator.rb +112 -0
  15. data/lib/jekyll-feed/meta-tag.rb +37 -0
  16. data/lib/jekyll-feed/page-without-a-file.rb +9 -0
  17. data/lib/jekyll-feed/version.rb +7 -0
  18. data/rams-jekyll-feed.gemspec +30 -0
  19. data/script/bootstrap +3 -0
  20. data/script/cibuild +7 -0
  21. data/script/fmt +10 -0
  22. data/script/release +7 -0
  23. data/script/test +4 -0
  24. data/spec/fixtures/_collection/2018-01-01-collection-doc.md +4 -0
  25. data/spec/fixtures/_collection/2018-01-02-collection-category-doc.md +5 -0
  26. data/spec/fixtures/_config.yml +9 -0
  27. data/spec/fixtures/_data/authors.yml +5 -0
  28. data/spec/fixtures/_drafts/2015-01-12-a-draft.md +4 -0
  29. data/spec/fixtures/_layouts/some_default.html +11 -0
  30. data/spec/fixtures/_posts/2013-12-12-dec-the-second.md +7 -0
  31. data/spec/fixtures/_posts/2014-03-02-march-the-second.md +6 -0
  32. data/spec/fixtures/_posts/2014-03-04-march-the-fourth.md +9 -0
  33. data/spec/fixtures/_posts/2015-01-18-jekyll-last-modified-at.md +5 -0
  34. data/spec/fixtures/_posts/2015-02-12-strip-newlines.md +6 -0
  35. data/spec/fixtures/_posts/2015-05-12-liquid.md +7 -0
  36. data/spec/fixtures/_posts/2015-05-12-pre.html +8 -0
  37. data/spec/fixtures/_posts/2015-05-18-author-detail.md +9 -0
  38. data/spec/fixtures/_posts/2015-08-08-stuck-in-the-middle.html +6 -0
  39. data/spec/fixtures/_posts/2016-04-25-author-reference.md +6 -0
  40. data/spec/fixtures/feed.xslt.xml +0 -0
  41. data/spec/jekyll-feed_spec.rb +524 -0
  42. data/spec/spec_helper.rb +30 -0
  43. metadata +214 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 7f3cb511770a28bcfbbecf77ca8b578c914c4be693557caff990828efb6b2e19
4
+ data.tar.gz: 1589e07490b1b5045ef3a12a239c227dfc6a8ed87b6226cc67cd29e48ccd5704
5
+ SHA512:
6
+ metadata.gz: b6481cef834d7fb704efaf0a5088def0228d316f2d972fe22c41c5ed61b33284d99874afcbe59d18f9b40e64f839e4229a0b4bd818e07026af3e8b4a17720216
7
+ data.tar.gz: 8fa2a552cd1d1d3af2e26085a68feaba99d6553abe9496acc17f6281b5ba12a68e3e6bc2593772f3aa0da3d17cb9d3ed3ecccc7986dd6fa403f999dc3adc5244
@@ -0,0 +1,21 @@
1
+ /vendor
2
+ /.bundle/
3
+ /.yardoc
4
+ /Gemfile.lock
5
+ /_yardoc/
6
+ /coverage/
7
+ /doc/
8
+ /pkg/
9
+ /spec/reports/
10
+ /tmp/
11
+ *.bundle
12
+ *.so
13
+ *.o
14
+ *.a
15
+ mkmf.log
16
+ *.gem
17
+ Gemfile.lock
18
+ spec/dest
19
+ .bundle
20
+ spec/fixtures/.jekyll-metadata
21
+ spec/fixtures/.jekyll-cache
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --color
2
+ --format progress
@@ -0,0 +1,27 @@
1
+ require: rubocop-jekyll
2
+
3
+ inherit_gem:
4
+ rubocop-jekyll: .rubocop.yml
5
+
6
+ AllCops:
7
+ TargetRubyVersion: 2.3
8
+ Include:
9
+ - lib/**/*.rb
10
+
11
+ Exclude:
12
+ - .gitignore
13
+ - .rspec
14
+ - .rubocop.yml
15
+ - .travis.yml
16
+
17
+ - Gemfile.lock
18
+ - History.markdown
19
+ - LICENSE.txt
20
+ - README.md
21
+
22
+ - script/**/*
23
+ - vendor/**/*
24
+
25
+ Naming/MemoizedInstanceVariableName:
26
+ Exclude:
27
+ - lib/jekyll-feed/page-without-a-file.rb
@@ -0,0 +1,32 @@
1
+ language: ruby
2
+ cache: bundler
3
+ rvm:
4
+ - &latest_ruby 2.6
5
+ - 2.4
6
+ - 2.3
7
+ env:
8
+ global:
9
+ - NOKOGIRI_USE_SYSTEM_LIBRARIES=true
10
+ matrix:
11
+ - JEKYLL_VERSION="~> 3.8"
12
+ matrix:
13
+ include:
14
+ - rvm: *latest_ruby
15
+ env: JEKYLL_VERSION="~> 3.7.4"
16
+ - rvm: *latest_ruby
17
+ env: JEKYLL_VERSION=">= 4.0.0.pre.alpha1"
18
+ before_install:
19
+ - gem update --system
20
+ - gem install bundler
21
+ before_script: bundle update
22
+ script: script/cibuild
23
+ notifications:
24
+ email: false
25
+ deploy:
26
+ provider: rubygems
27
+ api_key:
28
+ secure: qz0q6ur0kGo03jjLdoAak6WcEAwxX2r9LG3DVrhOrcfoFipkuW+uwR0et4tpK8uFrz0P9y7eTIKOb0XCXeIsIXWj6R5benpRGr2U8m9A+tE/jxviBFUaxaokte0lqWiX1fEyhRmW3zvcdLQ47Vd2EwTNaq6ZmPulmEe9gS0rBQghyclakGlZ17LI7oGgiNL9SQ335Yqa1qJklTHYHbodWQ3Z07v7VN2jxqi3WH6NacT5gUGp5iCNCLLa8+jpKr4uONNIoy6/geAWdqtvgGUE8oTjIWDoJarrknJpqfx9Rd0KLDzkyneAigHDYPW60QtrE6GGpK/+TF1pF4DzdK2EgTWqGFnZf8ehfnxmtHVl2Xq/DPr6hS8Q/f+ut4ioMzBQxPD0hfh8/EOMYKsO8mOuOlYTiZXC7iuGyvFUOl2hnBgWA99t+I0NNB06qFp3ZxIjolEc3zjzc9f1a5HUXlEut5V8nqvCwbctNiTVpT8ZEWlsQlyRUnr9cIMUTEfLgQ+v6DnvAJBMO1EILq6liB5qfutjNhzhlREt7P/ZdppGsAzWpgt0q2PafqVoPe62WR3+/8Lj2ErMr034xSSqZVNcBS0mbdvW6k3jaABo1VJ4XuHm6/yDuemWzWb7kdG9/14+IIJMW1VuaWcmnCnB6gxjkCW3Dm2ftYiN7Rfn3AUz/nU=
29
+ gem: jekyll-feed
30
+ on:
31
+ tags: true
32
+ repo: jekyll/jekyll-feed
data/Gemfile ADDED
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+ gemspec
5
+
6
+ gem "jekyll", ENV["JEKYLL_VERSION"] if ENV["JEKYLL_VERSION"]
7
+
8
+ install_if -> { Gem.win_platform? } do
9
+ gem "tzinfo", "~> 1.2"
10
+ gem "tzinfo-data"
11
+ end
@@ -0,0 +1,165 @@
1
+ ## 0.13.0 / 2019-11-13
2
+
3
+ ### Minor Enhancements
4
+
5
+ * Excerpt only flag (#287)
6
+ * Add media:content tag (#290)
7
+
8
+ ### Development Fixes
9
+
10
+ * test: use categories in post (#249)
11
+
12
+ ## 0.12.1 / 2019-03-23
13
+
14
+ ### Bug Fixes
15
+
16
+ * Re-introduce Ruby 2.3 support and test Jekyll 3.7+ (#272)
17
+
18
+ ## 0.12.0 / 2019-03-21
19
+
20
+ * Allow Jekyll v4 (still alpha)
21
+
22
+ ### Development Fixes
23
+
24
+ * style: fix offenses in specs (#248)
25
+ * dev: update CI and style settings (#258)
26
+ * Enable testing for Windows platform (#265)
27
+
28
+ ## 0.11.0 / 2018-09-09
29
+
30
+ ### Development Fixes
31
+
32
+ * Require Ruby 2.3 (#222)
33
+ * Refactor to remove redundant calls and variables (#240)
34
+
35
+ ### Minor Enhancements
36
+
37
+ * Categories and collections (#228)
38
+ * Remove check for older version of Jekyll (#234)
39
+
40
+ ## 0.10.0 / 2018-06-04
41
+
42
+ ### Bug Fixes
43
+
44
+ * Escape image URL (#209)
45
+
46
+ ### Development Fixes
47
+
48
+ * Rubocop 0.55 (#223)
49
+ * Bump Rubocop (#230)
50
+
51
+ ### Minor Enhancements
52
+
53
+ * Support Typhoeus 1.0 (#232)
54
+
55
+ ## 0.9.3 / 2018-02-04
56
+
57
+ * Define path with __dir (#187)
58
+ * Bump Ruby for Travis (#188)
59
+
60
+ ### Documentation
61
+
62
+ * Fix: Add note about using plugins instead of gems key (#197)
63
+ * Add documentation for disabling smartify filter (#205)
64
+ * Use `https` in more places. (#165)
65
+
66
+ ### Development Fixes
67
+
68
+ * Rubocop: Target Ruby 2.2 (#195)
69
+ * Test feeds that have a `site.lang` (#164)
70
+ * Test against Ruby 2.5 (#201)
71
+
72
+ ### Minor Enhancements
73
+
74
+ * fix <entry> template for posts with post.lang defined (#168)
75
+
76
+ ## 0.9.3 / 2017-03-28
77
+
78
+ ## 0.9.1 / 2017-02-17
79
+
80
+ ### Minor Enhancements
81
+
82
+ * Update feed.xml (#162)
83
+
84
+ ## 0.9.0 / 2017-02-16
85
+
86
+ ### Minor Enhancements
87
+
88
+ * Use absolute_url to generate the feed_meta url (#150)
89
+ * Make feed stylesheet optional (#149)
90
+ * Use new `normalize_whitespace` filter (#143)
91
+ * Feed entries must contain <author> (#152)
92
+ * Remove trailing slash from feed ID (#159)
93
+
94
+ ### Development Fixes
95
+
96
+ * Simplify minify regular expression (#141)
97
+ * Namespace as JekyllFeed (#151)
98
+ * rubocop -a (#160)
99
+
100
+ ### Bug Fixes
101
+
102
+ * Filter out drafts before limit (#154)
103
+
104
+ ## 0.8.0 / 2016-10-06
105
+
106
+ * Use filters to clean up Liquid template (#134)
107
+
108
+ ### Minor Enhancements
109
+
110
+ * Don't set @site.config["time"] on feed generation (#138)
111
+
112
+ ### pedantry
113
+
114
+ * Appease Rubocop (#139)
115
+
116
+ ## 0.7.2 / 2016-10-06
117
+
118
+ * Support `image.path` when `post.image` is an object (#137)
119
+
120
+ ## 0.7.1 / 2016-09-26
121
+
122
+ * Assign `url_base` before first usage (#133)
123
+
124
+ ## 0.7.0 / 2016-09-06
125
+
126
+ * Use type="html" to skirt around double escaping problem (#127)
127
+
128
+ ## 0.6.0 / 2016-07-08
129
+
130
+ * Cleanup `post_author` logic (#113)
131
+ * Add XML stylesheet example with XSLT (#119)
132
+ * DRY up and add more doc (#120)
133
+ * Use smartify filter (#117)
134
+
135
+ ## 0.5.1 / 2016-04-18
136
+
137
+ * Fix mangling of whitespace when `site.lang` is set (#110)
138
+
139
+ ## 0.5.0 / 2016-04-13
140
+
141
+ * Consolidate regexps for stripping whitespace (#82)
142
+ * Only test against Jekyll 3 (#99)
143
+ * Think about how i18n might work (#75)
144
+ * Find author by reference (#106)
145
+ * Drop support for Jekyll 2 (#105)
146
+ * Add support for post image (#104)
147
+
148
+ ### Minor Enhancements
149
+
150
+ * Use Module#method_defined? (#83)
151
+ * Use site.title for meta tag if available (#100)
152
+
153
+ ### Development Fixes
154
+
155
+ * Do not require [**jekyll-last-modified-at**](https://github.com/gjtorikian/jekyll-last-modified-at) in tests (#87)
156
+ * Add Rubocop (#81)
157
+ * Correct typo in tests (#102)
158
+ * Simplify testing feed_meta tag (#101)
159
+ * Quiet known warnings in tests (#103)
160
+
161
+ ## 0.4.0 / 2015-12-30
162
+
163
+ * Feed uses `site.title`, or `site.name` if `title` doesn't exist (#72)
164
+ * Replace newlines with spaces in `title` and `summary` elements (#67)
165
+ * Properly render post content with Jekyll (#73)
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2015-present Ben Balter and jekyll-feed contributors
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,206 @@
1
+ # Jekyll Feed plugin
2
+
3
+ A Jekyll plugin to generate an Atom (RSS-like) feed of your Jekyll posts
4
+
5
+ [![Build Status](https://travis-ci.org/jekyll/jekyll-feed.svg)](https://travis-ci.org/jekyll/jekyll-feed) [![Gem Version](https://badge.fury.io/rb/jekyll-feed.svg)](https://badge.fury.io/rb/jekyll-feed)
6
+
7
+ ## Installation
8
+
9
+ Add this line to your site's Gemfile:
10
+
11
+ ```ruby
12
+ gem 'jekyll-feed'
13
+ ```
14
+
15
+ And then add this line to your site's `_config.yml`:
16
+
17
+ ```yml
18
+ plugins:
19
+ - jekyll-feed
20
+ ```
21
+
22
+ :warning: If you are using Jekyll < 3.5.0 use the `gems` key instead of `plugins`.
23
+
24
+ ## Usage
25
+
26
+ The plugin will automatically generate an Atom feed at `/feed.xml`.
27
+
28
+ ### Optional configuration options
29
+
30
+ The plugin will automatically use any of the following configuration variables, if they are present in your site's `_config.yml` file.
31
+
32
+ * `title` or `name` - The title of the site, e.g., "My awesome site"
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., `https://example.com`. If none is provided, the plugin will try to use `site.github.url`.
35
+ * `author` - Global author information (see below)
36
+
37
+ ### Already have a feed path?
38
+
39
+ Do you already have an existing feed someplace other than `/feed.xml`, but are on a host like GitHub Pages that doesn't support machine-friendly redirects? If you simply swap out `jekyll-feed` for your existing template, your existing subscribers won't continue to get updates. Instead, you can specify a non-default path via your site's config.
40
+
41
+ ```yml
42
+ feed:
43
+ path: atom.xml
44
+ ```
45
+
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.
47
+
48
+ ### Optional front matter
49
+
50
+ The plugin will use the following post metadata, automatically generated by Jekyll, which you can override via a post's YAML front matter:
51
+
52
+ * `date`
53
+ * `title`
54
+ * `excerpt`
55
+ * `id`
56
+ * `category`
57
+ * `tags`
58
+
59
+ Additionally, the plugin will use the following values, if present in a post's YAML front matter:
60
+
61
+ * `image` - URL of an image that is representative of the post (can also be passed as `image.path`)
62
+
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
+
65
+ ### Author information
66
+
67
+ *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.*
68
+
69
+ There are several ways to convey author-specific information. Author information is found in the following order of priority:
70
+
71
+ 1. An `author` object, in the documents's front matter, e.g.:
72
+
73
+ ```yml
74
+ author:
75
+ twitter: benbalter
76
+ ```
77
+
78
+ 2. An `author` object, in the site's `_config.yml`, e.g.:
79
+
80
+ ```yml
81
+ author:
82
+ twitter: benbalter
83
+ ```
84
+
85
+ 3. `site.data.authors[author]`, if an author is specified in the document's front matter, and a corresponding key exists in `site.data.authors`. E.g., you have the following in the document's front matter:
86
+
87
+ ```yml
88
+ author: benbalter
89
+ ```
90
+
91
+ And you have the following in `_data/authors.yml`:
92
+
93
+ ```yml
94
+ benbalter:
95
+ picture: /img/benbalter.png
96
+ twitter: jekyllrb
97
+
98
+ potus:
99
+ picture: /img/potus.png
100
+ twitter: whitehouse
101
+ ```
102
+
103
+ In the above example, the author `benbalter`'s Twitter handle will be resolved to `@jekyllrb`. This allows you to centralize author information in a single `_data/authors` file for site with many authors that require more than just the author's username.
104
+
105
+ *Pro-tip: If `authors` is present in the document's front matter as an array (and `author` is not), the plugin will use the first author listed.*
106
+
107
+ 4. An author in the document's front matter (the simplest way), e.g.:
108
+
109
+ ```yml
110
+ author: benbalter
111
+ ```
112
+
113
+ 5. An author in the site's `_config.yml`, e.g.:
114
+
115
+ ```yml
116
+ author: benbalter
117
+ ```
118
+
119
+ ### Meta tags
120
+
121
+ The plugin exposes a helper tag to expose the appropriate meta tags to support automated discovery of your feed. Simply place `{% feed_meta %}` someplace in your template's `<head>` section, to output the necessary metadata.
122
+
123
+ ### SmartyPants
124
+
125
+ The plugin uses [Jekyll's `smartify` filter](https://jekyllrb.com/docs/templates/) for processing the site title and post titles. This will translate plain ASCII punctuation into "smart" typographic punctuation. This will not render or strip any Markdown you may be using in a title.
126
+
127
+ Jekyll's `smartify` filter uses [kramdown](https://kramdown.gettalong.org/options.html) as a processor. Accordingly, if you do not want "smart" typographic punctuation, disabling them in kramdown in your `_config.yml` will disable them in your feed. For example:
128
+
129
+ ```yml
130
+ kramdown:
131
+ smart_quotes: apos,apos,quot,quot
132
+ typographic_symbols: {hellip: ...}
133
+ ```
134
+
135
+ ### Custom styling
136
+
137
+ Want to style what your feed looks like in the browser? Simply add an XSLT at `/feed.xslt.xml` and Jekyll Feed will link to the stylesheet.
138
+
139
+ ## Why Atom, and not RSS?
140
+
141
+ Great question. In short, Atom is a better format. Think of it like RSS 3.0. For more information, see [this discussion on why we chose Atom over RSS 2.0](https://github.com/jekyll/jekyll-rss-feed/issues/2).
142
+
143
+ ## Categories
144
+
145
+ Jekyll Feed can generate feeds for each category. Simply define which categories you'd like feeds for in your config:
146
+
147
+ ```yml
148
+ feed:
149
+ categories:
150
+ - news
151
+ - updates
152
+ ```
153
+
154
+ ## Collections
155
+
156
+ Jekyll Feed can generate feeds for collections other than the Posts collection. This works best for chronological collections (e.g., collections with dates in the filenames). Simply define which collections you'd like feeds for in your config:
157
+
158
+ ```yml
159
+ feed:
160
+ collections:
161
+ - changes
162
+ ```
163
+
164
+ By default, collection feeds will be outputted to `/feed/<COLLECTION>.xml`. If you'd like to customize the output path, specify a collection's custom path as follows:
165
+
166
+ ```yml
167
+ feed:
168
+ collections:
169
+ changes:
170
+ path: "/changes.xml"
171
+ ```
172
+
173
+ Finally, collections can also have category feeds which are outputted as `/feed/<COLLECTION>/<CATEGORY>.xml`. Specify categories like so:
174
+
175
+ ```yml
176
+ feed:
177
+ collections:
178
+ changes:
179
+ path: "/changes.xml"
180
+ categories:
181
+ - news
182
+ - updates
183
+ ```
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
+
200
+ ## Contributing
201
+
202
+ 1. Fork it (https://github.com/jekyll/jekyll-feed/fork)
203
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
204
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
205
+ 4. Push to the branch (`git push origin my-new-feature`)
206
+ 5. Create a new Pull Request