Allow categories: true to make feeds for all categories#379
Allow categories: true to make feeds for all categories#379jez wants to merge 2 commits intojekyll:masterfrom
categories: true to make feeds for all categories#379Conversation
|
(This is based on the fixed master commit now) |
|
Sorry about that, I didn’t realize that rubocop was set up for the repo, and I had forgotten to run that locally. I fixed the rubocop errors by factoring out my changes to a new method. Feel free to suggest any tweaks as you wish. |
|
Hello @jez, you needn't apologize for overlooking RuboCop offenses. It's part of the process.
Edit: I read the code wrong. |
|
@ashmaroli I saw you crossed out your request–is there anything else you'd like me to change about this PR? (otherwise, I think this change is ready to go) |
|
@ashmaroli friendly bump! |
|
Thanks for the ping, @jez. This had fallen off my radar. |
|
|
||
| ```yml | ||
| feed: | ||
| categories: true |
There was a problem hiding this comment.
On line 24 of generator.rb, we have special handling for config["tags"]. Do we intend to only generate collection-level categories?
| - updates | ||
| ``` | ||
|
|
||
| Or, to generate a feed for all categories: |
There was a problem hiding this comment.
We might want to explain that in the current implementation, this means that each collection will get its own category feed. This operates differently than tag-based feeds where they unify all documents from any collection into a single feed.
| collections: | ||
| changes: | ||
| path: "/changes.atom" | ||
| categories: true |
There was a problem hiding this comment.
Can we have a test for this? It seems like we could over-generate. That is we could generate a category feed which has zero entries since a collection doesn't have any documents with a category that is only present in another collection.
- Collection "posts" has categories "A" and "B"
- Collection "archives" has categories "C"
- Will we generate
/feed/archives/A.xmlwith zero entries?
Concerns raised by co-maintainer needs to be addressed
Motivation
Fixes #361
Summary
This change behaves like how
tags: trueworks, and like how @parkr suggestedin the comments of #361.
If there's anything you'd like changed in the implementation, please let me know.
Test plan
I've written a test case for this and also verified that it works for my
personal blog when I pass
categories: truein myfeed:settings.