11ty / 11ty-website

Documentation site for the Eleventy static site generator.

Home Page:https://www.11ty.dev/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Docs: use of pageEntry in pagination navigation

asheerrizvi opened this issue · comments

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.