11ty / 11ty/docs

Docs: use of pageEntry in pagination navigation

Open
#1,497 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Nunjucks
Stars
547
Forks
726
Avg merge
2h 23m
Merged PRs (30d)
3

Description

In the example for implementing pagination navigation we have this nav code:

<nav aria-labelledby="my-pagination">
  <h2 id="my-pagination">This is my Pagination</h2>
  <ol>
{%- for pageEntry in pagination.pages %}
    <li><a href="{{ pagination.hrefs[ loop.index0 ] }}"{% if page.url == pagination.hrefs[ loop.index0 ] %} aria-current="page"{% endif %}>Page {{ loop.index }}</a></li>
{%- endfor %}
  </ol>
</nav>

We name entity of pagination.pages as pageEntry, but within the if condition of the anchor tag we use page.url instead of pageEntry.url. I am somewhat confused if this is intentional or it should be pageEntry.url instead of page.url. Please close the issue if this isn't a relevant question.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Review the pagination navigation example in the issue, focusing on the loop variable pageEntry and the page.url reference in the anchor condition. Determine whether the example should use pageEntry.url; done means the documentation example consistently references the intended pagination entry.

Written by the indexing model from the issue text.

Assessment

Domain
documentation
Issue type
Documentation
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.