Range through a nested param with multiple elements

I have a .md, with the following structure for one of my params.

projects:

projects:
-   name: "example"
    desc: "example project"
    link: 
    -   type: "x32"
        url: "download/project-32.zip"
    -   type: "x64"
        url: "download/project-64.zip"
..

In my html file, I want to range through the links, but currently it is only working for the first one. What I am doing is (abstracted):

{{ range .Params.projects }}
        {{ range .link }}
                {{ .type }}: {{ .url }}
        {{ end }}
{{ end }}

The problem is that it is only outputting the first one, e.g. only the ‘x32’ and ‘download/project-64.zip’.

What can I do?

Thank you!

Hi there,

When I try to replicate your code I see the results correctly.

Do you have the rest of your code somewhere we can have a look at?

Hmm, that’s interesting, I wonder what I’m doing wrong… Sorry but I cannot provide the rest of the code as there is a lot of information I would have to block out unfortunately. Do you have any suggestions of things to check for? Thanks for your response :smiley:

Update: Thank you very much for your help, it turns out that it was working all along but it was an HTML error, and it just so happened that the cut-off point was the first one where there were multiple elements!

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