exif-photo-blog icon indicating copy to clipboard operation
exif-photo-blog copied to clipboard

Add RSS feed

Open ntadej opened this issue 7 months ago • 4 comments

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:

Screenshot 2025-04-12 at 19 37 20

ntadej avatar Apr 12 '25 17:04 ntadej

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

vercel[bot] avatar Apr 12 '25 17:04 vercel[bot]

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?

sambecker avatar Apr 12 '25 19:04 sambecker

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.

ntadej avatar Apr 13 '25 16:04 ntadej

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

sambecker avatar Apr 13 '25 19:04 sambecker

@ntadej do you want me to keep this PR open?

sambecker avatar May 10 '25 22:05 sambecker

Yes, please. Sorry for the delay, I plan to work on it in the next days.

ntadej avatar May 11 '25 00:05 ntadej

Yes, please. Sorry for the delay, I plan to work on it in the next days.

Amazing. Good luck!

sambecker avatar May 11 '25 00:05 sambecker

Sorry I was sick for the past week... I hope I can get back to it soon.

ntadej avatar May 26 '25 06:05 ntadej

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!

sambecker avatar May 26 '25 17:05 sambecker

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.

ntadej avatar Jun 08 '25 11:06 ntadej

Adding a few last refinements in #266 @ntadej let me know if you catch anything!

sambecker avatar Jun 13 '25 01:06 sambecker