Based on this guide, how can the code be re-written to:
Hide the first page button when on the second page.
Hide the last page button while on the second last page.
The reason for this is because a warning is thrown by the wave accessibility testing tool about redundant links (since in both cases, the previous and first page buttons and the next and last page buttons point to the same links in second page and second last page respectively).
If possible, how would the code be re-written so that the partial is called without the dict part? I.e. {{ partial "pagination.html" . }} (this is not as important.)
Perhaps that also isnāt what you want, but I ran each scenario through WAVE and got no messages about redundant links on any of the four pages (first, second, next-to-last, or last).
I noticed the warnings are not limited to those two pages. If, for example, the pagination is showing three numbered pages (2, 3, 4) and it has a previous and next page buttons, the latter will still throw a warning about redundant links e.g. when on page 3. I have never thought to check that before in pagination.
Update: I limited the links to only the active link per page. ({{- $slots := 1 }} from the linked pagination terse code)