Paginate returning Nil pages

My blog has a taxonomy for authors and right now it’s breaking with Hugo 123.4:

Error: error building site: render: failed to render pages: render of “term” failed: “/Users/brunoamaral/Labs/themes/soft-ui/layouts/authors/list.html:46:7”: execute of template failed: template: authors/list.html:46:7: executing “main” – is nil; wrap it in if or with: {{ with }}{{ .Render }}{{ end }}

The previous code was working,even when the author had less than 10 pages:

<div class="row align-items-start">
	{{ $paginatedPages := where .Data.Pages ".Params.options.unlisted" "!=" true }}
		{{ range (.Paginate $paginatedPages ).Pages}}
		<div class="col-lg-3 col-sm-6 mb-lg-3 mb-4">
			{{ .Render "summary" }}
	{{ end }}

Did I miss a breaking change?

(I can’t really share the whole code because I’m bound by the license agreement)

Is authors a taxonomy?

yes, and I double checked the config file

  tag: "tags"
  category: "categories"
  author: "authors"
  story: "stories"

the error happens in layouts/authors/list.html

Can you share the complete term list? I’m wondering about spaces, punctuation, etc.

I managed to create a repo just with the content (3Gb). There is one author with special characters in the name: António Dias.

I cannot reproduce the problem with the limited information I have.

thank you for trying anyway.

This morning I kept looking into it and found out that there was a file on content/tags/tag-name/ with an entry for author.

Removing it made the site build correctly. Taxonomies can’t belong to other taxonomies, and that makes sense from my perspective.

With v0.123.0 and later, terms added to term and taxonomy pages contribute to the taxonomy object. That was not intentional, but is potentially useful. But it looks like you found a problem, so we either need to revert the behavior (i.e., ignore terms applied to term and taxonomy pages), or fix the problem.

Either way, thanks for the heads up. This gives us something to work with.

1 Like

FYI. After trying several combinations I am still unable to reproduce this problem, so I can’t log a bug.

If you have a moment, please have a look at this simple test site to see if there’s something I can change to trigger the error:

git clone --single-branch -b hugo-forum-topic-48516 hugo-forum-topic-48516
cd hugo-forum-topic-48516
hugo server

I also can’t reproduce, but forked to share some parts of the theme. GitHub - brunoamaral/hugo-testing: Hugo test sites related to Forum topics or GitHub issues

Maybe relevant, /authors/ is listing categories and I was expecting to see it listing the current authors.

(On a side note, i’ll try to strip out the licensed code from my theme. It’s not a standard hugo theme because of the way I’m using tags and params, and the issue could be there.)

Not relevant… just me failing to update things after changing taxonomies to exactly match yours. I made that necessary corrections.Still can’t reproduce the problem, but thanks for letting me know.

@brunoamaral I’m marking this as resolved due to my inability to reproduce the problem with the information I have. Hopefully the next time this comes up, if it comes up, we’ll have a repository where we can easily and consistently reproduce the problem.

of course. And if something like this happens again I’ll strip out the copyrighted part of the html to see if I can share the whole code.

thank you @jmooring

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.