Get the Next and Previous Posts Through the Ghost API

#1

I am creating a custom SPA frontend to my ghost site using Quasar and the Ghost Content API, but I can’t find anything in the API that can get me the previous and next posts given the post that I am currently on. Is there any way to do this?

#2

You need to filter & limit the request to your Content API v2 using the Ghost-SDK.

You could take a look at the existing prev/next helper implementation in Ghost.


Furthermore, take a look at our JavaScript SDK helpers. We are working on making more and more of Ghost’s theme helpers available as general JavaScript helpers…but we’ve just started :slightly_smiling_face:

1 Like
#3

Perfect! Thank you, that’s exactly what I needed. I was going to need that read time helper too!

#4

This link has a . at the end that breaks it and causes a 404, could you fix that for anybody else who finds this? :slight_smile:

#5

Fixed :rofl:Thanks

closed #7

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.