Include Prev/Next Post URL in Content API Read Requests

It would be great to have previous and next post URLs when using fetching data from a read request to a Ghost Content API endpoint. For example, in the response to the following JS client request:

api.posts.read({slug: 'some-post-slug'})

I’m currently playing around with using the Content API within a Nuxt App for both a universal and statically generated blog. This feature would make it a lot easier to provide navigation links from within a post, and the feature is available when creating a handlebars template.

https://docs.ghost.org/api/handlebars-themes/helpers/prev_next_post/

@jacobgoodwin0 next/prev is completely dependent on context such as the channel/collection or intended filter query which isn’t available from a single API request. If you’re using the API the expectation is that you know your intended site structure enough to be able to construct a query for your desired next/prev post.

1 Like

Seems with New getPost api siblings I asked comparable question. While I see the context and filter challenges, I still maintain it is worthwhile to see if we can find some easy way out of this. Right now the load on the api-server gets a bit too high, just because our next and previous buttons…