I’ve been meaning to redo the tagging system ever since I first built my website, but was never really sure how I wanted to. I liked how I had relevant tag words tied to each post, but not how posts would show other posts using shared tags.
The old system was incredibly clunky and unhelpful. I honestly just threw a solution together for it without giving it thought, as at the time I didn’t consider it very important compared to getting the rest of the site done. It has honestly been bugging me enough for a while that I decided to take care of it. I came up with a solution for how I wanted it to work a few days ago and implemented it today.
All tags in both system link to their corresponding archive tag page.
The old version had 3 output sections which worked as follows:
- A list of the most recent 4 shared tags showing up to the 4 most recent posts for each of those tags, which often showed duplicate posts from preceding tags.
- A list of the rest of the shared tags.
- A list of the non-shared tags.
The system also sometimes ran over its vertical height limits :-\.
I find the new system much more helpful. It determines post relevancy by adding the reciprocals of the number of times each tag is shared.
So a tag is considered more relevant the less it is shared.
This new tagging system has 2 output sections which work as follows:
- The list of tags in descending order of relevance. Each tag is followed by its share count if not 0.
- The 4 most relevant shared posts in descending order of relevance. Each post takes up only 1 line with its horizontal overflow hidden. Each of these lines contains post name, number of shared tags, and a list of the shared tags in descending order of relevance.
This new system should never overflow vertically.
If I had engineered this properly from the start, I might have also included a weight for each tag on a post. This is no longer an option however as it would not be worth the effort going back and reweighing all previous posts. I’m not even sure if it would have been a good thing either, as tagging posts is already enough of a PITA without having to determine subjective weights.