👨👧👦 Astro Related Content #
If you ever wanted to add links to related blog posts or app features in your Astro blog or documentation site, then Astro related content, which we look at in this video, will set you going on the right track. We are talking about something like the ubiquitous “you liked X, why not try Y” recommendations, on e-commerce and streaming sites. Designing your own site, you might base your related links on SEO priorities, or use AI to generate a content graph. Either way, we see how you can update your Markdown front matter to include the necessary meta and have Astro render the related content links for you.
Although we focus on Markdown content, the technique works almost identically if you are working with Markdoc content source or even a data collection. Hopefully this intro describes what you are looking for. Hit play on the video to see! See the link, further down, for the complete code repo.
You can drop a comment below or reach out for a chat on Element as well as X @mention if you have suggestions for improvements or questions.
📹 Video #
🗳 Poll #
🖥 Astro Related Content Example Code #
Markdown Content Front Matter #
Content Collection Config #
Astro Content Template #
The full demo code is in the Rodney Lab GitHub repo .
🔗 Links #
- Astro Picture Component
- Astro Markdoc
- Astro Markdown Blog Starter
- Zod docs
- Element chat: #rodney matrix chat
- Twitter handle: @askRodney
🙏🏽 Feedback #
Have you found the post useful? Would you prefer to see posts on another topic instead? Get in touch with ideas for new posts. Also, if you like my writing style, get in touch if I can write some posts for your company site on a consultancy basis. Read on to find ways to get in touch, further below. If you want to support posts similar to this one and can spare a few dollars, euros or pounds, please consider supporting me through Buy me a Coffee.
Just dropped a new video on how you can use 🚀 Astro Content Collections and References to add a “Related Posts” widget to your content site.
— Rodney (@askRodney) November 10, 2023
Hope you find it useful!
#askRodneyhttps://t.co/r0LCUXWac1
Finally, feel free to share the post on your social media accounts for all your followers who will find it useful. As well as leaving a comment below, you can get in touch via @askRodney on X, @rodney@toot.community on Mastodon and also the #rodney Element Matrix room. Also, see further ways to get in touch with Rodney Lab. I post regularly on Astro as well as SEO. Also, subscribe to the newsletter to keep up-to-date with our latest projects.