GatsbyCentral / gatsby-awesome-pagination

An opinionated, more awesome approach to pagination in Gatsby
MIT License
109 stars 27 forks source link

Incorrect NextPagePath and PreviousPagePath When Using "/" As The Path Prefix #7

Closed ryanwiemer closed 6 years ago

ryanwiemer commented 6 years ago

Description Of Issue

screen shot 2018-09-20 at 3 11 49 pm

Expected Result

The README should provide clearer instructions on how to properly use the plugin when there is no path prefix. This may require adjusting the logic to either make that field optional and have default behavior or to correct the issue shown here.

chmac commented 6 years ago

Oooh, interesting. I looked into how Gatsby handles pages like /foo vs /foo/. I can call createPage() twice, with and without the trailing slash. They will be treated as separate pages by Gatsby, but only one of them will be rendered. The "winning" page will be rendered at both /foo and /foo/.

Anyway, I added some logic to test for a single / as the pathPrefix and generate proper path values. Released it as version 0.3.1 and hopefully your issue is fixed.

Thanks for reporting @ryanwiemer, really appreciate the feedback.