G33ky-Sozialzeugs

G33ky-Sozialzeugs

Soooo, how do static site generators deal with keeping the RSS/Atom item ID constant when renaming/moving posts? You know, to keep them from showing up as "unread" in your users' feed readers?

They don't, do they?

@scy derive the ID from something static, i.e. article row ID (when stored in a database), file name (when stored in a file system directly), etc.

@fogti Right, I've edited the post accordingly because I mean the popular ones that just take a bunch of (Markdown) files as their input, no database.

@scy ah okay.... either they don't, or they use some (optional) UUID stored in the file, or perhaps the inode of the input, but that's something I only imagine theoretically, and haven't seen anywhere yet.

@scy @fogti well, typically you just make the article-id based on the filename of your markdown source and/or the resulting main URL?

Never had a problem with gohugo doing that

@dat @fogti Which means the item will get a new ID when moving or renaming the input file.

@scy I don't think so. I think they use the path as the ID. But I think renames are not great anyways, they also invalidate existing links and bookmarks.

@Merovius Redirects exist…?

(Yes, they're a pain in most SSGs or not possible at all, but still. I should be able to rename stuff!)

@scy Sure.

FWIW I don't think there is any reason a SSG couldn't allow you to put an ID into the YAML frontmatter. Which you could then randomly generate, for example.

@Merovius From what I've seen, some indeed allow you to set an ID and pass it through to the feed. But even for those that support that, it's apparently a pretty obscure feature and mostly undocumented.

Also, I'm sure it can be fixed in theory in most of them, but I'm more interested in the actual behavior of actual existing SSGs right now, not how it _could_ be fixed.

@scy @fogti yeah, obviously

But you can do something else if you like.
I.e. all my articles have some numeric ID (just a property line in the header) because of how my blog once was a Hugo site before (and wordpress before that and blogger before that…)

I could use that instead.

But why would I? You want to keep URLs as static as possible anyways and it's probably better to keep the filename of the input and add some alternate URL without invalidating the old one.
replies
0
announces
0
likes
1

@scy Well, sorry for responding, then 🙄
I did make sure to answer that question first and directly.

@Merovius Sorry if that came across as rude. I meant it as "I'm not interested in continuing a conversation about theoretical solutions, because I know what they are", instead of simply ceasing to respond.

Thanks for your input.

@scy hard rule: slugs don’t change, ever.

@natecox Why not? What if you have a typo in it?

@scy because of the exact people you posted, it fucks with user experience. If you typo then you live with the typo, maybe be more cautious next time.

@natecox lol okay whatever dude

@scy @Merovius TBH give than the RSS/Atom feed is just another template file in your theme, it is more a question of "What does your theme support". And you can control that. you can make the build fail if you havent set the ID for the feed or have some fallback code for the slug. your SSG does not care about what logic you use there.

different static site hosting things even support _redirects/_headers so you can even get "forward to new link after rename"

@scy @natecox notice that they said "slug" and not title. The slug can be compiled from the original title, but once you publish the new version, the slug is part of the URL, which preferably shouldn't change, as not to need to manage redirections to new slug/URL, or generating 404s to everyone that has already seen the post.