Paginator seems to ignore the count of items to be displayed

I’d like to have in my home page a fixed number (in the example given, 6) of posts I’ve committed to my website. To do this and in the same time ignore any possible draft, I’ve used this following piece of code since 0.63 version.

 {{ range where (.Paginator 6).Pages ".Draft" false }}
 ....
{{ end }}

In the compilation, it seems Paginator totally ignore the number 6 and prints only four posts. I’ve read that paginator function might be deprecated but I never received any warning about it. I have tried to edit the number, but it seems it does not affect anything.

I’ve ran my website using the latest version of hugo at the time of writing and my page only had 4 posts, not six as I wanted.

It’s a custom basic theme (the piece of code is taken from theme/my/index.html) which I can not release due to NDA filled for my organization. No particular or relevant issues is being showed using --verbose flag.

Hi there,

Please read Requesting Help to see what information we need to be able to help.

I’ve included all the information. If any is missing, please expand “information we need”. Thanks

It’s in Requesting Help :

1 Like

Do you have any pages in addition to the posts?

I have:

  • “home” aka / (index.html template of my theme that contains that code snippet I posted)
  • posts/ (list of all the posts)
  • post/:slug

Again:

Otherwise, the answer is: it all works on my site, I don’t know what’s wrong with yours.

Again I can not publish the source code since all the code I wrote is under NDA.