What to achieve:
Displaying posts on specific category in Nuxt Content using AsyncData
async asyncData({ $content, params }) {
const tipsPosts = await $content('articles')
.where({ categories: { $contains: 'tips' }})
.sortBy('id', 'desc')
.fetch()
return {
tipsPosts
}
},
The filtering occur in line 3 using .where and $contains with the category name as parameter.