this post was submitted on 09 May 2025
21 points (86.2% liked)

Selfhosted

46654 readers
1057 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

Rules:

  1. Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.

  2. No spam posting.

  3. Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it's not obvious why your post topic revolves around selfhosting, please include details to make it clear.

  4. Don't duplicate the full text of your blog or github here. Just post the link for folks to click.

  5. Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).

  6. No trolling.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

founded 2 years ago
MODERATORS
 

Oh technomages of c/selfhosted, I come seeking your help once more because anywhere I look there's people trying to sell me on their service, something-something PODCASTS, or RSS for windows and all that, my brain cannot anymore.

I've got a blog I'm serving with nginx, and I would like to implement some sort of RSS feed. I'm pretty much new to the whole thing, but it was recommended to me. I did a bit of research and now I know those are like xml files that you subscribe to.

So, I wanted to know: In your experience, what is the best way to go about this? Do I have to make them myself by hand and put them in an /rss/ directory in the root of my blog? How do people subscribe to them? Got any resources?

I wouldn't mind writing them by hand actually, my whole website is hand-made, gluten free and organic. (maybe not the last one).

Thanks in advance <3

top 30 comments
sorted by: hot top controversial new old
[–] TORFdot0@lemmy.world 3 points 1 day ago

I’d agree with others that have said to use a framework like Hugo to serve an RSS feed. I wrote an automation using Google apps script to scrape blog pages and manually update the RSS feed but it was more trouble than it was worth. Letting your framework automatically update your feed is much easier.

[–] tauren@lemm.ee 6 points 2 days ago* (last edited 1 day ago) (1 children)

What powers your blog? If it's some platform like WordPress, then an RSS feed might be built-in or added with a plugin. Otherwise, you'd have to create and maintain it manually.

https://www.w3schools.com/XML/xml_rss.asp

[–] bladewdr@infosec.pub 4 points 1 day ago

If you're using Hugo it also creates an RSS feed by default every time you build the site.

[–] gsquirrel@lemmings.world 11 points 3 days ago (2 children)

Creating an RSS feed by hand is no harder than creating HTML pages - it's just an XML file, basically.

This page has some decent advice to get started with:

https://lmnt.me/blog/how-to-make-a-damn-website.html

[–] KazuchijouNo@lemy.lol 1 points 1 day ago

Thanks a bunch! I'll check it out!

[–] 486@lemmy.world 3 points 3 days ago (2 children)

This is not quite true. As I mentioned in my other comment already, each feed entry needs its own unique UUID. You have to generate such a UUID for every entry.

[–] exu@feditown.com 13 points 3 days ago (1 children)

Per the RSS specification the guid field is optional.

And if you do want to provide it, any string works. So just count up from 1, use the title, current date or whatever for that field.

[–] 486@lemmy.world 4 points 3 days ago (1 children)

Thanks for pointing this out. I thought this had to be an actual UUID. Generating a unique string of arbitrary format manually is certainly much easier to do manually without additional tools.

[–] arjache@fedia.io 4 points 3 days ago

it can also just be the permalink for the post, which each post ought to have anyway. in RSS you can set isPermaLink=“true” on the guid to indicate it’s a permalink.

[–] akademy@lemm.ee 3 points 3 days ago

It's pretty easy to create a uuid. There are many ways to do it. Which is best for you would depend on how you're generating your website.

[–] 486@lemmy.world 5 points 3 days ago* (last edited 3 days ago) (2 children)

How do people subscribe to them?

Subscribing to an RSS feed really is nothing more than telling your RSS client about the URL to that RSS XML file. The RSS client then regularily checks the URL for changes.

If your site is hand-made as you say, you would have to manually create and update the RSS file also. This is quite a nuisance, not only because it is XML, but also because every feed entry needs its own unique UUID, which you need to create. Perhaps you could create a script that does it for you. Static site generators are usually able to automatically create an RSS feed for you.

[–] KazuchijouNo@lemy.lol 1 points 1 day ago (1 children)

Can I do the UUID generation with the uuidgen command? Also, I'm learning python and bash, so perhaps I could do something with cron(? I guess what I need is some sort of template or examples so I can get started

The whole point is learning cool stuff :D

[–] 486@lemmy.world 1 points 1 day ago

Yes, using uuidgen should work fine.

[–] prof@infosec.pub 6 points 3 days ago

I use Hugo for static site generation and it makes the RSS stuff for me.

[–] Xanza@lemm.ee 4 points 3 days ago (1 children)

In your experience, what is the best way to go about this?

RSS feeds are static files with formatted XML list items. When a feed is updated to include a new XML list item, the reader application notifies users who are subscribed that there's been a change. There are actually no moving parts to RSS feeds, which is what makes them so popular. RSS feed applications simply loads an XML feed and counts the number of XML objects. When the application checks again, if there are new objects, then the feed has been updated and you get your little notification.

That's it. It's a static file (like HTML), and it works like magic. You don't need any software or libraries to create an RSS feed over and above being able to serve static XML.

So unless you're updating your feed several times per day, I would just do it by hand. Maybe write a little helper script to scratch out the formatted XML based on input.

Do I have to make them myself by hand and put them in an /rss/ directory in the root of my blog?

You can, but it's really not necessary. If you check around github you can find a ton of projects that help you create RSS feeds.

[–] KazuchijouNo@lemy.lol 1 points 1 day ago

Thanks! This is really helpful, I'll use this rss xml template.

[–] rikudou@lemmings.world 4 points 3 days ago

Depends on what you use for the blog. Most blogging software does have RSS support. If you're writing the blog by hand, you need to create the RSS manually, or if there's some kind of source for the blog posts, generate it from the source data.

[–] just_another_person@lemmy.world 4 points 3 days ago (2 children)

Are you talking about just a straight HTML/CSS static blog, or is it created in a framework of some sort?

[–] KazuchijouNo@lemy.lol 1 points 1 day ago

Literally hand-written static html + css

[–] A_norny_mousse@feddit.org 4 points 3 days ago

This is the important question. On my blog software It's just one short page written in the blog's templating language, very easy to create from scratch.

If the blog is a collection of plain HTML pages, you'll somehow need to collect the pertinent info first (e.g. the ten newest pages, their titles, a short summary).

[–] Strit@lemmy.linuxuserspace.show 3 points 3 days ago (1 children)

Don't most blog software provide rss feeds?

I know Ghost does, by just adding /rss to the link in question. So you can link to the whole blog, specific tags or even specific posts this way.

[–] KazuchijouNo@lemy.lol 1 points 1 day ago

I am my blog software.

I'm pretty much doing everything by hand with vim and nginx :D

[–] abeorch@friendica.ginestes.es -1 points 3 days ago (2 children)

@KazuchijouNo Just install something like WordPress which generates RSS of posts automatically. Bonus you can add the Activitypub plug in and syndicate your content with Mastodon etc.

[–] KazuchijouNo@lemy.lol 1 points 1 day ago

I appreciate the advice, although it'd go against mu core principle of "doing it myself unless it's unfeasible" besides, I don't quite much like wordpress.

[–] rikudou@lemmings.world 4 points 3 days ago (2 children)

Don't ever install WordPress, just let it die. It's slow, insecure and the owner is a dick.

[–] irmadlad@lemmy.world 1 points 2 days ago (2 children)

Don’t ever install WordPress, just let it die

I've never run wordpress, but it always fascinates me at the number of daily exploits that get released for WP. It seems to me that the core WP is solid, but it's all the plugins that open up unintentional attack surfaces.

[–] rikudou@lemmings.world 3 points 1 day ago

Can't speak for nowadays, but long ago when I dabbled in WordPress myself, the code was pretty shitty and insecure.

[–] catloaf@lemm.ee 1 points 1 day ago

The core isn't much better.

[–] abeorch@friendica.ginestes.es 1 points 3 days ago (1 children)

@rikudou Its open source. The owner will die .. the software can live forever.

[–] rikudou@lemmings.world 1 points 2 days ago

It doesn't become less insecure, though.