File tree Expand file tree Collapse file tree 3 files changed +41
-1
lines changed Expand file tree Collapse file tree 3 files changed +41
-1
lines changed Original file line number Diff line number Diff line change @@ -153,6 +153,13 @@ feed:
153
153
- updates
154
154
` ` `
155
155
156
+ Or, to generate a feed for all categories :
157
+
158
+ ` ` ` yml
159
+ feed:
160
+ categories: true
161
+ ` ` `
162
+
156
163
# # Posts limit
157
164
158
165
By default the plugin limits the number of posts in the feed to 10. Simply define a new limit in your config :
@@ -193,6 +200,16 @@ feed:
193
200
- updates
194
201
` ` `
195
202
203
+ Or pass `categories : true` to generate a feed for all categories:
204
+
205
+ ` ` ` yml
206
+ feed:
207
+ collections:
208
+ changes:
209
+ path: "/changes.atom"
210
+ categories: true
211
+ ` ` `
212
+
196
213
# # Excerpt Only flag
197
214
198
215
Optional flag `excerpt_only` allows you to exclude post content from the Atom feed. Default value is `false` for backward compatibility.
Original file line number Diff line number Diff line change @@ -69,7 +69,16 @@ def collections
69
69
70
70
@collections = normalize_posts_meta ( @collections )
71
71
@collections . each_value do |meta |
72
- meta [ "categories" ] = ( meta [ "categories" ] || [ ] ) . to_set
72
+ meta_categories = meta [ "categories" ]
73
+ for_collection = case meta_categories
74
+ when Array
75
+ meta_categories
76
+ when true
77
+ @site . categories . keys
78
+ else
79
+ [ ]
80
+ end
81
+ meta [ "categories" ] = for_collection . to_set
73
82
end
74
83
75
84
@collections
Original file line number Diff line number Diff line change @@ -423,6 +423,20 @@ def to_s
423
423
end
424
424
end
425
425
426
+ context "with top-level post categories (using true to mean all)" do
427
+ let ( :overrides ) do
428
+ {
429
+ "feed" => { "categories" => true }
430
+ }
431
+ end
432
+
433
+ it "outputs feeds for all categories" do
434
+ site . categories . each_key do |category |
435
+ expect ( Pathname . new ( dest_dir ( "feed/#{ category } .xml" ) ) ) . to exist
436
+ end
437
+ end
438
+ end
439
+
426
440
context "with collection-level post categories" do
427
441
let ( :overrides ) do
428
442
{
You can’t perform that action at this time.
0 commit comments