I created my site with pagination using the template in the readme, but I have found that the links to paginated index pages become wrong after refreshing a page, for example:
When you are in http://example.com/2/ and refresh the page, links to previous/next pages become something like http://example.com/2/1/, http://example.com/2/3/
This problem seems to occur only when I build a static site, and not via gatsby develop.
As a workaround, I've changed urls passed to NavLink to the following ones to make them always link to the paths relative to the root path.
<div className="previousLink">
<NavLink test={first} url={`/${previousUrl}`} text="Go to Previous Page" />
</div>
<div className="nextLink">
<NavLink test={last} url={`/${nextUrl}`} text="Go to Next Page" />
</div>
I am not sure this is a problem related to Gatsby itself rather than gatsby-paginate though.
I created my site with pagination using the template in the readme, but I have found that the links to paginated index pages become wrong after refreshing a page, for example:
http://example.com/2/
and refresh the page, links to previous/next pages become something likehttp://example.com/2/1/
,http://example.com/2/3/
This problem seems to occur only when I build a static site, and not via
gatsby develop
.As a workaround, I've changed urls passed to
NavLink
to the following ones to make them always link to the paths relative to the root path.I am not sure this is a problem related to Gatsby itself rather than gatsby-paginate though.