Skip to content
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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jez
Copy link
Contributor

@jez jez commented Dec 24, 2022

Motivation

Fixes #361

Summary

This change behaves like how tags: true works, and like how @parkr suggested
in 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 my feed: settings.

@jez
Copy link
Contributor Author

jez commented Dec 31, 2022

(This is based on the fixed master commit now)

@jez
Copy link
Contributor Author

jez commented Dec 31, 2022

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.

@ashmaroli
Copy link
Member

ashmaroli commented Jan 1, 2023

Hello @jez, you needn't apologize for overlooking RuboCop offenses. It's part of the process.

Anyways, I'm finding the use of param name meta confusing now that the logic has been abstracted to a separate definition.
How about using collection itself

Edit: I read the code wrong.

@jez
Copy link
Contributor Author

jez commented Jan 5, 2023

@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)

@jez
Copy link
Contributor Author

jez commented Jan 26, 2023

@ashmaroli friendly bump!

@ashmaroli
Copy link
Member

Thanks for the ping, @jez. This had fallen off my radar.

ashmaroli
ashmaroli previously approved these changes Jan 27, 2023
Copy link
Member

@ashmaroli ashmaroli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@ashmaroli ashmaroli requested a review from parkr January 27, 2023 10:56

```yml
feed:
categories: true
Copy link
Member

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:
Copy link
Member

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
Copy link
Member

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.

  1. Collection "posts" has categories "A" and "B"
  2. Collection "archives" has categories "C"
  3. Will we generate /feed/archives/A.xml with zero entries?

@ashmaroli ashmaroli dismissed their stale review February 5, 2023 19:00

Concerns raised by co-maintainer needs to be addressed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Generate feeds for all categories, instead of only configured categories
3 participants