exif-photo-blog
exif-photo-blog copied to clipboard
Add RSS feed
I thought it would make sense to have a RSS feed for such a webpage (as the content is also in a feed).
For now I opted for manual string generation as I did not want to introduce additional dependencies (also this is based on the Next.js example). I'm happy to iterate on the actual implementation.
The feed is very simple: title + description and the photo with the creation time (and not the time when photo was taken). For additional information the webpage can be visited.
Here's a screenshot how the Reeder app renders my photos:
@ntadej is attempting to deploy a commit to the Sam Becker Pro Team on Vercel.
A member of the Team first needs to authorize it.
Love this idea.
Can it share more structure/logic with /app/api/route.ts which does something similar?
We'll also probably want to listen for NEXT_PUBLIC_PUBLIC_API configuration.
I actually wonder if this eventually just replaces that feature?
I think these are two separate features. I envision the RSS feed to only provide very basic information but some may want to query the API for more details. Also JSON is nowadays more friendly than XML for API.
I can certainly add a flag to conditionally enable or disable the RSS (I would enable it by default but I leave it up to you).
I'll check if there's some duplicated functionality with the API. Maybe it also makes sense to factor-out XML rendering to a separate helper file.
Also JSON is nowadays more friendly than XML for API
Totally agreed—could be nice to just offer a programmatic feed in both formats with the same content? /api/feed.json and /api/feed.xml?
add a flag to conditionally enable or disable
💯—with the approach above, think they probably share a flag? ENABLE_PUBLIC_FEED=1?
factor-out XML rendering to a separate helper file
This sounds like a nice approach
@ntadej do you want me to keep this PR open?
Yes, please. Sorry for the delay, I plan to work on it in the next days.
Yes, please. Sorry for the delay, I plan to work on it in the next days.
Amazing. Good luck!
Sorry I was sick for the past week... I hope I can get back to it soon.
Sorry I was sick for the past week... I hope I can get back to it soon.
No problem! Just shipped #260 in case it's helpful.
Feel better soon!
OK, I have some cleaned-up implementation now. I kept the /rss.xml endpoint as it seems more standard and obvious what it represents, but I added the /feed.json as proposed which holds the same data in JSON format.
It's now an opt-in feature.
Adding a few last refinements in #266 @ntadej let me know if you catch anything!