-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
💡 RFC: Support for JSON feeds #1113
Comments
I would love to see this happen as well for the automatic rss support + potentially as another example of generating non-html files based on Astro data. |
There’s not really any technical limitations from this happening. In theory we could also support JSON feed, Atom 1.0, and anything else. Worst case scenario would just be a bit of boilerplate, but it’d still be much better than the alternative of doing everything yourself from scratch (and would still have the efficiency benefit of rendering all your HTML for multiple pages and some schema file from the same fetch call, which is as good as it gets). |
This could be a nice help for quick Algolia support as well. I've seen a few 11ty projects that take advantage of it's data pipeline and templating to build an |
@brycewray #1305 is a general solution to dynamically creating files. Does that fulfill this issue, if it were to be accepted? |
@matthewp Probably, but I agree with the comment in that issue re seeing how other SSGs do it. I know Eleventy does it through a plugin (https://www.11ty.dev/docs/plugins/rss/) and Hugo does it through built-in Go templates (https://gohugo.io/templates/rss/). |
It would definitely be nice to include the ability to import external file templates from npm - so there can be a package that allows you to create a json feed via the endpoint api or whatever we end up doing, rather than requiring you to write your own / have one holy implementation 😁 |
IMO #1305 could be a general-purpose solution, even for RSS, and including JSON feeds. I’d want to merge this RFC into that, if possible. |
Hey everyone! Our current RFC process is beginning to break down at this size, with over 50 open RFCs currently in the "discussing" stage. A growing community is a great problem to have, but our ability to give you RFC feedback has suffered as a result. In an effort to improve our RFC process, we are making some changes to better organize things. From now on, all RFCs will live in a standalone repo: https://github.com/withastro/rfcs This allows us to do three things: 1) Use threaded discussions for high-level ideas and improvements, without necessarily requiring an implementation for every idea. 2) Improve the quality of our RFC template and the speed/quality of all feedback. 3) Support inline comments and explicit approvals on RFCs, via a new Pull Request review process. We hope that this new process leads to better RFC weekly calls and faster feedback on your RFCs from maintainers. More detail can be found in the new RFC repo README. We can't automatically convert this issue to an RFC in the new repo because new RFC template is more detailed that this one. But, you can still continue this discussion in the new repo by creating a new Discussion in the RFC repo and copy-and-pasting this post (and any relevant follow-up comments) into it. Discussions are available for high-level ideas and suggestions without the requirement of a full implementation proposal. Then, when you are ready to propose (or re-propose) an implementation for feedback and approval, you can create a new RFC using the new RFC template. More detail about how to do this can be found in the new RFC repo README. Thanks for your patience as we attempt to improve things for both authors and reviewers. If you have any questions, don't hesitate to reach out on Discord. https://astro.build/chat |
Background & Motivation
Just as there currently is a way to produce an RSS feed, I would like for there to be also a way to produce a JSON feed (for more information about this, see https://jsonfeed.org). In my Eleventy site I was able to adapt an RSS-generating template to do this, so am hoping it's similarly easy to do this in Astro.
Proposed Solution
Possible solutions
rss
object so that it can also produce JSON feeds.jsonfeed
?) to produce JSON feeds.Alternatives considered
N/A
Risks, downsides, and/or tradeoffs
Given that many newsreader apps support both RSS and JSON feeds and that there are certain advantages to the latter (as noted at https://www.jsonfeed.org/2017/05/17/announcing-json-feed.html), it would be unfortunate if Astro lacked this ability.
Open Questions
N/A
Note: I lack the coding ability to provide a PR, hence my answer under "Help make it happen!" Wish I could help in that regard.
Detailed Design
No response
Help make it happen!
The text was updated successfully, but these errors were encountered: