Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prev/Next buttons don't have logical ordering #860

Closed
wlynch opened this issue Jul 20, 2023 · 1 comment · Fixed by #1586
Closed

Prev/Next buttons don't have logical ordering #860

wlynch opened this issue Jul 20, 2023 · 1 comment · Fixed by #1586
Assignees
Labels
platform development Chaingaurd Academy dev work

Comments

@wlynch
Copy link
Member

wlynch commented Jul 20, 2023

Describe the bug

Previous/Next buttons don't seem to link to expected pages - they appear to jump around with no logical ordering (though the links are consistent).

To Reproduce

Next chain:

Expected behavior

Next button follows side bar navigation, e.g.

Screenshots

Desktop (please complete the following information):

  • OS: macOS Ventura 13.4.1
  • Browser: Chrome
  • Version: 114.0.5735.198

Additional context

n/a

@max-allan-cgr
Copy link
Contributor

Also seen in:
https://edu.chainguard.dev/chainguard/chainguard-images/overview/
At the end, the Next button jumps to the API reference for Enforce. And the end of the API spec "Next" jumps back to "How To Use" in Images.
image

@ltagliaferri ltagliaferri added the platform development Chaingaurd Academy dev work label Mar 26, 2024
@smythp smythp self-assigned this May 23, 2024
smythp added a commit that referenced this issue May 28, 2024
## Type of change

Bug fix

### What should this PR do?

This PR rewrites the site navigation Instead of going to random pages,
it creates a depth-first run of the site (up to five levels) to collate
all sections in order, extracts relevant pages from each section,
creates a master listed page collection in order of weight, then moves
the user along site using that flattened collection.

One detail here is that the implementation will go through all "regular"
pages on a level, then go down or forward (in the tree) to the next
section. This does make a difference, as in a few places we have a
section nested in the middle of another section, but I think it works
fine as a previous/next implementation.

### Why are we making this change?

The previous and next buttons have a functionally random behavior on the
current version of the site.

### What are the acceptance criteria? 

We should check that this solution doesn't break anything. In terms of
behavior, it can only be an improvement to the previous and next
buttons, but we also don't want anything else to get affected on the
site.


### How should this PR be tested?

Try out the behavior of the previous and next buttons. They should
(mostly) line up with the left sidebar, and I used a similar approach to
the sidebar code (depth-first to five levels). The overview page is the
first page and should only have a next button. I think the video on
sigstore is the last page. Unlisted pages should not appear.

### Notes

I just want to complain about how Hugo handles stuff. The previous and
next logic is reversed (why?) and their previous and next method
implementation is incredibly naive.

Resolves #860

---------

Signed-off-by: Patrick Smyth <patrick.smyth@chainguard.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform development Chaingaurd Academy dev work
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants