On my homepage I have created a partial and would like to display each team member. However I can only seem to display the information from “about” and “sponsors” using the following:
{{ $sections := (.Site.GetPage "section" "about").Sections }}
{{ range $sections }}
<p>Title: {{ .Title }}</p>
{{ end }}
I was hoping this would work but it breaks:
{{ $sections := (.Site.GetPage "section" "about/our-team").Sections }}
{{ range $sections }}
<p>Title: {{ .Title }}</p>
{{ end }}
{{ range $subsection := (.Site.GetPage "section" "about" "our-team") }}
Section Page: {{ .Title }}<br>
{{ end }}
it returns the following error:
ERROR 2018/07/23 11:52:42 Error while rendering “home” in “”: template: index.html:42:11: executing “index.html” at <partial "meet-the-te…>: error calling partial: template: partials/meet-the-team.html:13:61: executing “partials/meet-the-team.html” at <“our-team”>: range can’t iterate over {0xc04419cd00 0xc042fb3ec0 section Pages(1) [] [] [0xc0440c4f00] map[date:{0 63624070800 0xc043428420} lastmod:{0 63624070800 0xc0434283c0} publishdate:{0 63624070800 0xc043428420} description:A list of team members title:Our team draft:false iscjklanguage:false]
Please include a link to your Hugo project’s source code to investigate further.
Or if you cannot share include some dummy content.
Also regarding the error you get, if you are on the latest Hugo 0.45 that was released yesterday, please have a look at the release notes and associated documentation.