-
Notifications
You must be signed in to change notification settings - Fork 990
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
Added support for multiple feeds (i.e. generating both Atom and RSS) #2477
Conversation
Ah I just realized I need to run |
Forgot rustfmt 😅 |
I've tested this for my own website and generating two feeds seems to work without a problem, both at the root level of the website and for taxonomies. It should be ready to merge now unless there's some issues I couldn't find. |
@LunarEclipse363 Story of my life. |
For reference, this PR is ready to merge, the force-push was just a rebase where the only conflict was in the changelog. The CI failing now is unrelated to the PR, it looks like some dependency increased its MSRV:
|
Can you rebase on the next branch? I've fixed the CI except for Windows |
I would be tempted to just do a breaking change if there's no easy way to indicate that the single name is deprecated. |
I would recommend against that. Unless there is a way to make it a hard error to use the old syntax, it will mean that suddenly Zola quietly stops generating feeds for existing projects, which would be terrible UX. I actually ran into this while testing - Zola just ignores the old configuration keys without an error if there is no compatibility mechanism. Would adding I'm not sure if that would allow us to get a good error message specific to the deprecated fields though, I would need to look into what kind of error the deserializer returns and if it allows checking for this sort of information. |
It would be nice yes. The migration guide can be added to the changelog |
fdbdd09
to
fae17a5
Compare
This is more complicated than it needs to purely because there is one test that apparently requires that you can put arbitrary keys into the front-matter instead of only into an Anyway, this only adds a special deprecation message for the front matter (I figured out how to do it in the end, it's not pretty) and relies on Very much a breaking change now, and I imagine Anyway, everything is in the changelog so I guess it's fine. |
Which test is that? |
I don't remember off the top of my head but if you add |
That test was invalid, you can just do:
|
- Fixed language config merge bug found by a test - Adjusted two existing tests to fully check stuff related to multiple feeds - Added a new test for backwards-compatibility of the changes - Fixed bugs found by the newly added test
…his found in tests
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.
Nice, thanks
…2477) * Added support for multiple feeds * Implemented backwards-compatibility for feed config * Added a test for feed config backwards-compat, fixed bugs - Fixed language config merge bug found by a test - Adjusted two existing tests to fully check stuff related to multiple feeds - Added a new test for backwards-compatibility of the changes - Fixed bugs found by the newly added test * Renamed MightBeSingle to SingleOrVec * Made the multiple feeds config changes "loudly" backwards-incompatible * added #[serde(deny_unknown_fields)] to front-matter, fixed problems this found in tests
@LunarEclipse363 while I appreciate the flexibility that this patch brings to Zola, I think that this might catch users by surprise:
I think the correct way to handle this could have been:
To be clear: I appreciate the time you took to deliver this patch, just my .2 cents on what I think could be the fallout here |
|
Regarding earlier versions that explored other solutions:
see commit 2dae1d1
|
I think in that case the breaking change was ok since old usage would error out. |
…etzola#2477) * Added support for multiple feeds * Implemented backwards-compatibility for feed config * Added a test for feed config backwards-compat, fixed bugs - Fixed language config merge bug found by a test - Adjusted two existing tests to fully check stuff related to multiple feeds - Added a new test for backwards-compatibility of the changes - Fixed bugs found by the newly added test * Renamed MightBeSingle to SingleOrVec * Made the multiple feeds config changes "loudly" backwards-incompatible * added #[serde(deny_unknown_fields)] to front-matter, fixed problems this found in tests
Zola v0.19.0 adds support for generating multiple feeds [1]. However, this also introduces a breaking change. This means that the 'generate_feed' option in the 'config.toml' is no longer called 'generate_feed' but 'generate_feeds'. Therefore, replace 'generate_feed' with 'generate_feeds' in the 'config.toml' to avoid build errors. Link: getzola/zola#2477 [1] Signed-off-by: Stefan Kühnel <git@stefankuehnel.com>
Introduction
As requested many times before, for example:
Potential improvements
I don't know if/how Zola handles deprecating config options, if there's anything I should add to let the user know the feed related options changed please let me know how to do it.Implemented backwards-compatibility as suggested by @selfisekai
Formalities
Sanity check:
Code changes
next
branch?If the change is a new feature or adding to/changing an existing one: