"How do you deal with code snippets in blog posts getting outdated?"
Every time I give a talk about blogging for developers, I'm asked this. Now I started to take action with the first iteration of the solution.
I added version metadata to my blog posts and display them at the start of the post.
https://hamatti.org/posts/track-software-versions-for-technical-blog-posts/

Track software versions for technical blog posts
Code snippets in blog posts are at a risk of becoming outdated which can cause annoyances for the reader. I’ve been asked about how I approach this multiple times and now it’s time to actually address this situation.
hamatti.org · Juha-Matti Santala - Community Builder. Dreamer. Adventurer.
Link author:
Juhis@hamatti@mastodon.world