Showing related posts beneath a blog post is a great way to give your visitors more to read and encourage them to spend more time on your site. Existing methods of showing related content include matching posts by tags or by manually adding related posts to your frontmatter. Both of these work, and I used to use tag-based related posts myself, but I wanted something a bit less manual. It's a perfect use-case for vector embeddings to help tell what content is similar to other content. I have created an integration for Astro sites called Astro Related Content (@philnash/astro-related-content) that generates related posts for your content collections that you can display in your UI. You can see an example of this in action at the bottom of this post and every blog post on my site. Read on to find out how to use it. What are vector embeddings? A vector embedding is a list of floating-point numbers that represents the meaning of a body of text. Vectors are points in a multidimensional…
No comments yet. Log in to reply on the Fediverse. Comments will appear here.