Get blogposts for "see also" in nuxt.js

I have a nuxt static blog where I want to automatically create a "See also" section but I am unsure about the best way to do this.

Doing something like

const blogPosts = await $prismic.api.query($prismic.predicates.at('document.type', 'blogpost'), {
      orderings: '[my.blogpost.post_date desc]',
      pageSize: 100,
    })

and then slicing the array to get e.g. three random items - on every single blog post page generation - doesn't seem like the best way to do this. I will end up with a static generated site in the end, but still doesn't seem right :slight_smile:

Have anyone else tried something like this?

Hi Morten,

I might need some more information about what you are trying to implement.
What I understood is that you want to suggest some random articles automatically with the same Custom Type.

If that is the case, the way you have suggested can work, but It might be better to use the similar predicate somehow to suggest other pages. For more, please refer to this article.

Another way to implement (the way implemented in our docs) would be by creating a Slice w/ Content Relationships or using a Group field to select certain documents to display at the bottom of the page.

This way, you can select documents that you think are actually relevant to the user at that time. But this will require the content author(s) to add these for each page,

Fares

This thread has been closed due to inactivity. Flag to reopen.