swilgosz/hanamimastery

Add related Articles Component

swilgosz opened this issue · 2 comments

Overview

Create component, that lists itmes that are related based on the arguments passed.

ITEMS == Articles (Stray) and the Episodes

Input:

  • List of tags.
  • Number of items to list.
  • article to be excluded

Usually it'll list 3/4 items, but that should be configurable.

Algorithm

  1. Filter items that contain at least one tag included in the provided list.
  2. Those that contain more tags from the list should appear first.
  3. When there are no matching results, show random or recent three articles.
  4. When there is article being excluded, it should not appear under any conditions. The reason is, that this component will be shown mostly in the sidebar or below the article content, and we don't want to see "Related" articles listing the currently visited one.

When there are no matching results, show random or recent three articles.

Do you think it might be misleading for the reader? If there are no related articles, I would expect there not to be any articles, not some random one. That would have been frustrating.

@adamszwaba you are right, but then I would rather just change the widget title. Instead "Related articles", show: "Other interesting posts" when there are no matching results.

Also

  1. One of the reasons for this feature is to improve internal linking in the project fir engagement and seo.
  2. This algorithm will serve as a base for further improvements in the future where there will be more content to compare