-
Notifications
You must be signed in to change notification settings - Fork 207
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow categories: true
to make feeds for all categories
#379
base: master
Are you sure you want to change the base?
Conversation
(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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
|
||
```yml | ||
feed: | ||
categories: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On line 24 of generator.rb, we have special handling for config["tags"]
. Do we intend to only generate collection-level categories?
@@ -153,6 +153,13 @@ feed: | |||
- updates | |||
``` | |||
|
|||
Or, to generate a feed for all categories: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.xml
with zero entries?
Concerns raised by co-maintainer needs to be addressed
Motivation
Fixes #361
Summary
This change behaves like how
tags: true
works, 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: true
in myfeed:
settings.