I would like to build a shortcode that outputs mutiple icons with custom labels. Here is how the shortcode would be used in practice:
{{< icons "icon1" "icon1 fancy label" "icon2" "icon2 fancy label" >}}
<!-- The list of icons could be longer ->
I’m having some trouble implementing the template like so:
{{ range $i,$e := .Params }}
<img src = '/imageDiretory/{{ icon }}.extension' alt = '{{ iconLabel }}'>
<div class = 'someFancyClass'>{{ iconLabel }}</div>
<!--
icon1 & icon 2 would be the icon values
...
the other values would be the icon Labels
-->
{{ end }}
The problem with the above implementation is that it wouldn’t quite work because every two iterations would cover one icon details. I hope I’m being clear
Has anyone come across this sort of scenario? Or someone with some neat approach?
Thanks in advance.