bridgetown-feed 2.1.0 → 3.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +3 -2
- data/CHANGELOG.md +8 -0
- data/README.md +49 -19
- data/bridgetown-feed.gemspec +3 -2
- data/lib/bridgetown-feed/builder.rb +0 -2
- data/lib/bridgetown-feed/feed.xml +3 -1
- data/lib/bridgetown-feed/version.rb +1 -1
- data/lib/bridgetown-feed.rb +4 -0
- metadata +24 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0022d28402f7e79f811a1df43bf7f4c567781e9508d239046e0ae7e80fd9579c
|
4
|
+
data.tar.gz: 4aa6a196a889b0481c62341643dab88ae65d269dba1fa24a0f76562b4ab81a13
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 76df5d22dc22e825d6a6acfd8381c0ea83ca8c7e43f05767720b0334a759f6a367b25838fbb3803a13f3002f909f19801048d11f8b11147577e024c4df1f7436
|
7
|
+
data.tar.gz: 034f66ff0399a8ad53035f404734e475760d287deb624203b16386f84a527ea99c798750d57f3b0216a278e574100d04879fda2c46a2fffbe80efd14d09c30ff
|
data/.rubocop.yml
CHANGED
@@ -5,8 +5,6 @@ inherit_gem:
|
|
5
5
|
|
6
6
|
AllCops:
|
7
7
|
TargetRubyVersion: 2.5
|
8
|
-
Include:
|
9
|
-
- lib/**/*.rb
|
10
8
|
|
11
9
|
Exclude:
|
12
10
|
- .gitignore
|
@@ -14,6 +12,8 @@ AllCops:
|
|
14
12
|
- .rubocop.yml
|
15
13
|
- .travis.yml
|
16
14
|
|
15
|
+
- Rakefile
|
16
|
+
- "*.gemspec"
|
17
17
|
- Gemfile.lock
|
18
18
|
- History.markdown
|
19
19
|
- LICENSE.txt
|
@@ -21,4 +21,5 @@ AllCops:
|
|
21
21
|
|
22
22
|
- script/**/*
|
23
23
|
- vendor/**/*
|
24
|
+
- spec/**/*
|
24
25
|
|
data/CHANGELOG.md
CHANGED
@@ -4,6 +4,14 @@
|
|
4
4
|
|
5
5
|
...
|
6
6
|
|
7
|
+
## 3.1.0 / 2024-02-01
|
8
|
+
|
9
|
+
* Add an option to set the post_limit (@jbennett)
|
10
|
+
|
11
|
+
## 3.0.0 / 2022-10-08
|
12
|
+
|
13
|
+
* Upgrade to initializers system in Bridgetown 1.2
|
14
|
+
|
7
15
|
## 2.1.0 / 2021-10-26
|
8
16
|
|
9
17
|
* Update test suite and ensure generated pages have the right permalink
|
data/README.md
CHANGED
@@ -2,20 +2,34 @@
|
|
2
2
|
|
3
3
|
A Bridgetown plugin to generate an Atom (RSS-like) feed of your Bridgetown posts and other collection documents.
|
4
4
|
|
5
|
-
## Installation
|
5
|
+
## Installation for Bridgetown 1.2+
|
6
6
|
|
7
7
|
Run this command to add this plugin to your site's Gemfile:
|
8
8
|
|
9
9
|
```shell
|
10
|
-
$ bundle add bridgetown-feed
|
10
|
+
$ bundle add bridgetown-feed
|
11
11
|
```
|
12
12
|
|
13
13
|
Or simply add this line to your Gemfile:
|
14
14
|
|
15
15
|
```ruby
|
16
|
-
gem 'bridgetown-feed'
|
16
|
+
gem 'bridgetown-feed'
|
17
17
|
```
|
18
18
|
|
19
|
+
And then add the initializer to your configuration in `config/initializers.rb`:
|
20
|
+
|
21
|
+
```ruby
|
22
|
+
Bridgetown.configure do
|
23
|
+
# existing config here
|
24
|
+
|
25
|
+
init :"bridgetown-feed"
|
26
|
+
end
|
27
|
+
```
|
28
|
+
|
29
|
+
(For Bridgetown 1.1 or earlier, [read these instructions](https://github.com/bridgetownrb/bridgetown-feed/tree/v2.1.0).)
|
30
|
+
|
31
|
+
## Usage
|
32
|
+
|
19
33
|
The plugin exposes a helper tag to expose the appropriate meta tags to support automated discovery of your feed.
|
20
34
|
|
21
35
|
Simply place `feed_meta` someplace in your layout's `<head>` section to output the necessary metadata.
|
@@ -30,12 +44,6 @@ Simply place `feed_meta` someplace in your layout's `<head>` section to output t
|
|
30
44
|
<%= feed_meta %>
|
31
45
|
```
|
32
46
|
|
33
|
-
### Atom is nice and all, but what about JSON Feed?
|
34
|
-
|
35
|
-
[It's on our roadmap.](https://github.com/bridgetownrb/bridgetown-feed/issues/1) 🙂
|
36
|
-
|
37
|
-
## Usage
|
38
|
-
|
39
47
|
The plugin will automatically generate an Atom feed at `/feed.xml`.
|
40
48
|
|
41
49
|
### Optional configuration options
|
@@ -88,35 +96,35 @@ There are several ways to convey author-specific information. Author information
|
|
88
96
|
|
89
97
|
```yml
|
90
98
|
author:
|
91
|
-
|
99
|
+
name: Issac Asimov
|
92
100
|
```
|
93
101
|
|
94
102
|
2. An `author` object, in the site's `_data/site_metadata.yml`, e.g.:
|
95
103
|
|
96
104
|
```yml
|
97
105
|
author:
|
98
|
-
|
106
|
+
name: Issac Asimov
|
99
107
|
```
|
100
108
|
|
101
109
|
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:
|
102
110
|
|
103
111
|
```yml
|
104
|
-
author:
|
112
|
+
author: iasimov
|
105
113
|
```
|
106
114
|
|
107
115
|
And you have the following in `_data/authors.yml`:
|
108
116
|
|
109
117
|
```yml
|
110
|
-
|
111
|
-
picture: /
|
112
|
-
|
118
|
+
iasimov:
|
119
|
+
picture: /images/marina.jpg
|
120
|
+
name: Issac Asimov
|
113
121
|
|
114
|
-
|
115
|
-
picture: /
|
116
|
-
|
122
|
+
jwhite:
|
123
|
+
picture: /images/jared.jpg
|
124
|
+
name: Jared White
|
117
125
|
```
|
118
126
|
|
119
|
-
In the above example, the author `
|
127
|
+
In the above example, the author `iasimov`'s name will be resolved to `Issac Asimov`. This allows you to centralize author information in a single `_data/authors.yml` file for site with many authors that require more than just the author's username.
|
120
128
|
|
121
129
|
*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.*
|
122
130
|
|
@@ -132,6 +140,8 @@ There are several ways to convey author-specific information. Author information
|
|
132
140
|
author: marina
|
133
141
|
```
|
134
142
|
|
143
|
+
The author keys the plugin can read are `name`, `email`, and `uri` (for linking to an author's website).
|
144
|
+
|
135
145
|
### SmartyPants
|
136
146
|
|
137
147
|
The plugin uses [Bridgetown's `smartify` filter](https://www.bridgetownrb.com/docs/liquid/filters) 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.
|
@@ -204,6 +214,26 @@ feed:
|
|
204
214
|
The same flag can be used directly in post file. It will be disable `<content>` tag for selected post.
|
205
215
|
Settings in post file has higher priority than in config file.
|
206
216
|
|
217
|
+
## Post Limit
|
218
|
+
|
219
|
+
Optional flag `post_limit` allows you to set a limit to the number of posts shown in the feed. Default value is `10`.
|
220
|
+
|
221
|
+
When it is set in `bridgetown.config.yml`, all collections will be limited:
|
222
|
+
|
223
|
+
```yml
|
224
|
+
feed:
|
225
|
+
post_limit: 25
|
226
|
+
```
|
227
|
+
|
228
|
+
The same flag can also be set on a collection:
|
229
|
+
|
230
|
+
```yml
|
231
|
+
feed:
|
232
|
+
collections:
|
233
|
+
changes:
|
234
|
+
post_limit: 25
|
235
|
+
```
|
236
|
+
|
207
237
|
## Testing
|
208
238
|
|
209
239
|
* Run `bundle exec rspec` to run the test suite
|
data/bridgetown-feed.gemspec
CHANGED
@@ -15,11 +15,12 @@ Gem::Specification.new do |spec|
|
|
15
15
|
spec.test_files = spec.files.grep(%r!^spec/!)
|
16
16
|
spec.require_paths = ["lib"]
|
17
17
|
|
18
|
-
spec.required_ruby_version = ">= 2.
|
18
|
+
spec.required_ruby_version = ">= 2.7.0"
|
19
19
|
|
20
|
-
spec.add_dependency "bridgetown", ">= 1.
|
20
|
+
spec.add_dependency "bridgetown", ">= 1.2.0.beta2", "< 2.0"
|
21
21
|
|
22
22
|
spec.add_development_dependency "bundler"
|
23
|
+
spec.add_development_dependency "rss"
|
23
24
|
spec.add_development_dependency "nokogiri", "~> 1.6"
|
24
25
|
spec.add_development_dependency "rake", "~> 13.0"
|
25
26
|
spec.add_development_dependency "rspec", "~> 3.0"
|
@@ -44,7 +44,9 @@
|
|
44
44
|
{% if page.category %}
|
45
45
|
{% assign posts = posts | where: "category",page.category %}
|
46
46
|
{% endif %}
|
47
|
-
{%
|
47
|
+
{% assign post_limit = site.feed.collections[page.collection].post_limit | default: site.feed.post_limit | default: 10 %}
|
48
|
+
{% assign post_limit = site.feed.collections[page.collection].post_limit | default: site.feed.post_limit %}
|
49
|
+
{% for post in posts limit: post_limit %}
|
48
50
|
<entry{% if post.lang %}{{" "}}xml:lang="{{ post.lang }}"{% endif %}>
|
49
51
|
<title type="html">{{ post.title | smartify | strip_html | normalize_whitespace | xml_escape }}</title>
|
50
52
|
<link href="{{ post.absolute_url | default: post.url | absolute_url }}" rel="alternate" type="text/html" title="{{ post.title | xml_escape }}" />
|
data/lib/bridgetown-feed.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bridgetown-feed
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bridgetown Team
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-02-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bridgetown
|
@@ -16,7 +16,7 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 1.
|
19
|
+
version: 1.2.0.beta2
|
20
20
|
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
22
|
version: '2.0'
|
@@ -26,7 +26,7 @@ dependencies:
|
|
26
26
|
requirements:
|
27
27
|
- - ">="
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: 1.
|
29
|
+
version: 1.2.0.beta2
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
32
|
version: '2.0'
|
@@ -44,6 +44,20 @@ dependencies:
|
|
44
44
|
- - ">="
|
45
45
|
- !ruby/object:Gem::Version
|
46
46
|
version: '0'
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: rss
|
49
|
+
requirement: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - ">="
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
54
|
+
type: :development
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
requirements:
|
58
|
+
- - ">="
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: '0'
|
47
61
|
- !ruby/object:Gem::Dependency
|
48
62
|
name: nokogiri
|
49
63
|
requirement: !ruby/object:Gem::Requirement
|
@@ -120,7 +134,7 @@ dependencies:
|
|
120
134
|
- - "<"
|
121
135
|
- !ruby/object:Gem::Version
|
122
136
|
version: '2.0'
|
123
|
-
description:
|
137
|
+
description:
|
124
138
|
email: maintainers@bridgetownrb.com
|
125
139
|
executables: []
|
126
140
|
extensions: []
|
@@ -144,7 +158,7 @@ homepage: https://github.com/bridgetownrb/bridgetown-feed
|
|
144
158
|
licenses:
|
145
159
|
- MIT
|
146
160
|
metadata: {}
|
147
|
-
post_install_message:
|
161
|
+
post_install_message:
|
148
162
|
rdoc_options: []
|
149
163
|
require_paths:
|
150
164
|
- lib
|
@@ -152,15 +166,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
152
166
|
requirements:
|
153
167
|
- - ">="
|
154
168
|
- !ruby/object:Gem::Version
|
155
|
-
version: 2.
|
169
|
+
version: 2.7.0
|
156
170
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
157
171
|
requirements:
|
158
172
|
- - ">="
|
159
173
|
- !ruby/object:Gem::Version
|
160
174
|
version: '0'
|
161
175
|
requirements: []
|
162
|
-
rubygems_version: 3.
|
163
|
-
signing_key:
|
176
|
+
rubygems_version: 3.5.3
|
177
|
+
signing_key:
|
164
178
|
specification_version: 4
|
165
179
|
summary: A Bridgetown plugin to generate an Atom feed of your Bridgetown posts
|
166
180
|
test_files: []
|