chore: clean up pagination and sidebar navigation #1020
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue
While browsing the docs I noticed the pagination functionality wasn't working exactly how I thought it should be on some pages. Specifically, on the API Gateway page, I noticed the
pagination_next
button skipped over the child page Get started - Deliver and secure APIs in production and went directly to the Device Gateway Overview page instead.This presents an accessibility issue for those that use assistive technology to read the docs—especially screen readers and keyboard navigation—where those users may not visually see that the pagination buttons aren't taking them to the actual next page of a particular section.
I dove into the code a bit and saw in the sidebars.js#L427-L44 file that the
guides/
directory is set toautogenerated
, meaning the hard-codedpagination_prev
andpagination_next
values are unnecessary on all pages in theguides/
directory.While I was there, I noticed some of the
sidebar_position
values were not in the proper sequential order, so I updated those, too.Action taken
pagination_prev
andpagination_next
values on all pages in theguides/
directoryintegrations/index
, updatedpagination_next
fromnull
tointegrations/1password/index
network-edge/index
, updatedpagination_next
fromdomains-and-tcp-addresses
tonetwork-edge/cloud-endpoints
sidebar_position
values for all pages in theguides/
directory.Result
All the pages in the
guides/
directory, theintegrations/index
page, and thenetwork-edge/index
page now have the expected flow for their pagination buttons.This also improves the accessibility of the docs for those using assistive technology, as the pages now go to the actual next page in the docs instead of skipping over content.
Testing and validation
I tested changes while using a local dev server using
pnpm run start
.I verified the changes built successfully by running
pnpm run build
.All changes were made on a WSL2 Ubuntu instance on Win11.