HOWTO: Select penultimate and antipenultimate Data.Pages

Hi everybody,

Out of 10 articles, I want to select the penultimate and antipenultimate (article 8 and 9, but not 10).

How can I manage that with Hugo ?

Thanks in advance.

Bruno

{{ range (first 2 (last 3 .Data.Pages)) }}
1 Like

There is also the index func:

$articleEight := index .Pages 7

Note the index is zero-based.

1 Like

Resolved. Thank you very much for your help !