Presenting JSON data properly

I have a JSON file, where i’m presenting the data from.
It’s working fine, but i have some formating issues.

The json file looks like this :

“Name” : “Fran”,
“Time” : “For Time”,
“Description” : [
“21 - 15 - 9 Reps for time”,
“thrusters 95/65 LB”,
“Equipment” : [
“Pull-Up Bar”,
“Skill_Level” : “Medium”,
“Type” : “Girl”,
“Other” : “”

And i’m presenting it using this code :

    {{ range $data.wod }}
    <div class="w-full rounded overflow-hidden shadow-lg">          
      <div class="px-6 py-4">
        <div class="font-bold text-xl mb-2">{{ .Name }}</div>
        <p class="text-gray-700 text-base">
          {{ .text }}
          Type : {{ .Time }}
          Description : {{ .Description }}
          Equipment : {{ .Equipment }}
          Skill Level : {{ .Skill_Level}}
          Type : {{ .Type }}
          Other : {{ .Other }}

My problem is, that i would like to present the data, in “Description” as multiple lines.
Today it’s being shown as a single line.

I’m guessing that i need to run thru it as a loop again ?

I can’t get my head around how to fix this.


Something like this, may be?

<p>Description: <ul>
{{ range .Description }}
{{ end }}
1 Like

Thanks. It’s a lot closer, but there is no data, only .

Any idea ?


instead of . should fix that, shouldn’t it?


You are fantastic. Thank you so much.

That worked :slight_smile:

If you know how many hours i have spend trying to get this to work :slight_smile:

Thanks :slight_smile:

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