This is an extension of the previous question How to display an image from a “related” page. The issue is very similar, but dealing with an array of related pages rather than a single one, it seems much more difficult.
Specifically, I want to display the thumbnail images and names of multiple authors of an article. The authors are referenced in the article frontmatter by uuid, not name:
thanks for this article, I had found the lack of information about .RelatedIndices on gohugo mildly unhelpful…
Very good semantic, intelligent function, what I expect from a modern program !
But in his case I’m not sure it would be any faster or simpler than a simpler where. But more scalable, of course. Also, is it a case where this system is not used / does not take time when you don’t ask for it?
Thank you for this article. My understanding is that to use Hugo’s Related methods the related pieces of content must share a common Page.param that relates them. In my case, I want to relate contributors: to uuid:. Am I missing something?
but it should. publish the error messages. How are your pages structured ? Of course the code depends on it. Please show the arborescence of your content directory (use the command “tree”)
No problem, given the patience the elders of this place had for me, now I can return the favors for those less experienced than me. For my code to make a bit of sense, you need your content to be structured like this:
Also, rectification:
use .Site.Pages, not .Pages .Pages is an alias for .Data.Pages meaning it only looks under your current page context. so it’s not gonna see anything of course.
I must say I’m never sure how to write image urls since I only ever use global assets.
give the html code so I can correct. I think {{ .Params.avatar }} would suffice.