artsy / artsy.github.io

The Artsy Engineering Open-Source Developers Blog
https://artsy.github.io
MIT License
1.09k stars 227 forks source link

feat: add "similar articles" functionality #FF #750

Closed anandaroop closed 1 year ago

anandaroop commented 1 year ago

What

This PR adds the ability to include a short list of related articles at the bottom of each article on the blog.

For example the article at Accessing the Relay Store Without a Mutation might include a block such as the following:

You might also like

(Real example from the current batch^)

Why

The goal here was to find a simple + low-stakes use case to start experimenting with:

Everything seems to work well so far.

How

The idea is that any dev at any time (preferably an author right after adding a new post) could simply foreman run bundle exec rake related_articles and ta-da the related-articles.json file is re-generated.

They'd then commit the changes to this file, and everything should just work, thanks to some client-side javascript that tells the the article page to fetch data from that json manifest sitting on the server.

TODO:

anandaroop commented 1 year ago

Yeah good q, I made a pragmatic decision not to futz with CI, thought that could certainly be a reasonable next step. For now just an infrequent manual task, to keep things simple.

anandaroop commented 1 year ago

Alright this is rebased on top of the blocker in https://github.com/artsy/artsy.github.io/pull/751 and mergeable now.

Going for it! #FF