Skip to content

Instantly share code, notes, and snippets.

@justrjlewis
Created July 6, 2016 13:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save justrjlewis/824bcde072b587eb5ccc6603423818ad to your computer and use it in GitHub Desktop.
Save justrjlewis/824bcde072b587eb5ccc6603423818ad to your computer and use it in GitHub Desktop.
hugo taxonomy array iteration partial
<!-- speaker bios -->
{{ with .Params.speakername }}
<hr />
<div style="margin-bottom: 25px;">
<p style="color:rgba(159, 0, 1, 1); margin-top:10px; text-transform:uppercase;">
<span style="border-bottom: 1px solid;">presenter information</span>
</p>
{{ range $index, $element := $.Params.speakername }}
{{ if gt (len $.Params.speakername) 0 }}
<div style="margin-left: 22px;">
<p style="line-height: 18px;">
<span style="color: rgb(152, 27, 30);">
{{ index $.Params.speakername $index }}
{{ with $.Params.speakertitle }}
&#x02016;
{{ end }}
</span>
{{ with $.Params.speakertitle }}
{{ if gt (len $.Params.speakertitle) 0 }}
{{ $title := index $.Params.speakertitle $index }}
{{ $title }}
{{ end }}
{{ end }}
</p>
<p style="line-height: 18px;">
{{ with $.Params.speakeremail }}
{{ if gt (len $.Params.speakeremail) 0 }}
{{ $email := index $.Params.speakeremail $index }}
<span style="color: rgb(218, 98, 0);">Email:</span>&nbsp;<a href="mailto:{{ $email }}">{{ $email }}</a><br />
{{ end }}
{{ end }}
{{ with $.Params.speakerwebsite1 }}
{{ if gt (len $.Params.speakerwebsite1) 0 }}
{{ $website1 := index $.Params.speakerwebsite1 $index }}
<span style="color: rgb(218, 98, 0);">Website:</span>&nbsp;<a href="{{ $website1 }}">{{ $website1 }}</a><br />
{{ end }}
{{ end }}
</p>
<p style="">
{{ with $.Params.speakerbio }}
{{ if gt (len $.Params.speakerbio) 0 }}
{{ $bio := index $.Params.speakerbio $index }}
{{ $bio | markdownify }}
{{ end }}
{{ end }}
</p>
</div>
{{ end }}
{{ end }}
</div>
{{ end }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment