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

Generate web feeds #25

Closed
robinmetral opened this issue Aug 6, 2024 · 1 comment · Fixed by #38
Closed

Generate web feeds #25

robinmetral opened this issue Aug 6, 2024 · 1 comment · Fixed by #38

Comments

@robinmetral
Copy link
Owner

robinmetral commented Aug 6, 2024

Swap the unmaintained (?) jpmonette/feed (last commit two years ago) for the ubiquitous NaturalIntelligence/fast-xml-parser.

It will need a bit more work to put together but should be more stable in the long run.

(Also, we can use the same library for generating other XML content such as sitemaps: #17)

Edit: this was slightly inaccurate: brut was never using jpmonette/feed, websites using brut were using it in a prebuild step.

@robinmetral robinmetral changed the title Generate RSS feeds using fast-xml-parser Generate web feeds Aug 14, 2024
@robinmetral
Copy link
Owner Author

robinmetral commented Aug 14, 2024

Decided to not build feed generation into brut. Instead, users can use mustache templating to generate their own feeds.

I don't want to abstract this away, since feeds should be crafted with as much care as any page list. Say there is a single "posts" collection, but we only render posts with "frontmatter.featured === true" on the homepage. In this case, we should probably have two feeds, featured posts and all posts.

This kind of use cases would be impossible to achieve without really complicated config options, since how things are listed can depend on a number of custom metadata (tags! categories! featured posts!).

Instead, since #38 users can generate their own feeds with mustache, using the same context (view) as for HTML pages. I think that's pretty nice.

I think that at the end of the day, the main reason why most generators abstract web feed generation away is because they assume that developers don't want to look at XML. Instead of hiding feeds under the carpet, I'd prefer adding example of how to generate a nice Atom/RSS2 (but preferably Atom) feed for a brut website: added to the list of things to document at #23.

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 a pull request may close this issue.

1 participant