Add Next and Previous Links to a Gatsby Blog

Share this video with your friends

Send Tweet

Gatsby’s createPage action allows for additional data to be passed in via context. In this lesson, we will add a processing step to include links between posts, and update our templates to conditionally display them as appropriate.

Zone Chen
Zone Chen
~ 6 years ago

in the video, there is no words of title in the link, it seems undefined.

Gefen Technologies
Gefen Technologies
~ 6 years ago

The prev and next links show undefined instead of the title because the query in gatsby-node.js requires just the path field. You should add title as well.