bridgetownrb / bridgetown

A next-generation progressive site generator & fullstack framework, powered by Ruby
https://www.bridgetownrb.com
MIT License
1.13k stars 114 forks source link

Add equivalent to `RelatedPosts` for resource engine #305

Closed jaredcwhite closed 3 years ago

jaredcwhite commented 3 years ago

The posts collection has had a "related posts" feature (via page.related_posts), which optionally uses the classifier-reborn gem to perform LSI for better relevance. Currently that is missing from the new resource engine.

We should review this type of functionality before adding it to resources. At the very least, make it generic (not just for posts) and more configurable. (For example, why is 10 hard-coded as the number of posts returned?) We should also think about how it works relative to "fast render" contexts—for example maybe it should cache the results so it doesn't need to recalc every time. The current "class accessor" memoization is iffy at best.

jaredcwhite commented 3 years ago

P. S. Thinking of using the term "similar" rather than "related" because we have relations now as well as improved taxonomy, so "related" could imply explicit relationships between content. Instead, similar implies some sort of algorithm to determine which pieces of content are the most alike.

jaredcwhite commented 3 years ago

The more I think about this, the more it feels like this is a separate gem, or at least a new gem in the monorepo. There could be any number of algorithms or approaches people might want to use to index their content, so we should probably make sure bridgetown-core just provides the necessary hooks and leave the actual indexing mechanism up to "third-parties". Same thing with excerpts/summarization (#306).

jaredcwhite commented 3 years ago

With the resource extensions feature rolling out, anyone (and probably not me TBH) will be able to add a similar resources feature via a gem-based plugin that utilizes LSI or whatever. I'm going to go ahead and close this issue.