I've installed the Related plugin for docpad and what I want to do is I want it to display five random related posts in the sidebar of every blogpost. At the moment I have it set up this way in my post.html.jade
:
div
h4 Related posts:
each doc in getRelatedDocuments().slice(0,5)
a(href=doc.url)= doc.title
br
So, it displays 5 posts, but they aren't random. How do I shuffle the output of getRelatedDocuments()
?