Include Prev/Next Post URL in Content API Read Requests


#1

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/


#2

@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.