It's been a hot minute since I've made a blog entry, and while I don't believe in New Year's Resolutions, I did decide to try to make at least one post a month in 2025 just to keep some sort of a schedule, generate some blog content, and have a reason to keep tinkering with and improving the site. For January, I decided to do a simple update I've been thinking about for a while: tags!
I made a simple tags table (literally just id and name) and then created a junction table (posts_tags) that maps post ids to tag ids, then I added a field to the create page (admins only!) that lets me put in a comma separated list of values, and then generates the appropriate new tags and creates the records in the junction table so I can look up the tags when loading a post. Then I modified the post layout to include the tags at the bottom with links that add the tag as a query param. Clicking on one loads a list of posts with the same tag. I also modified the pagination code to keep the tag param around when navigating between pages!
So yeah, pretty small update, not a lot of interesting screenshots or ground-breaking coding concepts, but it was a fun little feature to add, and hopefully I'll have at least 11 more posts this year to justify needing the tagging feature in the first place. I also back-filled some tags on all the old posts so you can see this feature in action. Cheers!