# Range and index

**URL:** <https://discourse.gohugo.io/t/range-and-index/24421>\
**Category:** support\
**Created:** [April 2, 2020, 9:57pm UTC](https://discourse.gohugo.io/t/range-and-index/24421 "2020-04-02T21:57:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ptitnux](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/ptitnux/32/10717_2.png) [@Ptitnux](https://discourse.gohugo.io/u/Ptitnux)\
**Post date:** [April 2, 2020, 9:57pm UTC](https://discourse.gohugo.io/t/range-and-index/24421/1 "2020-04-02T21:57:44Z")

</div>

hi i created a authors taxonomy where i add name and pictures in my blog with cards design on for listing all articles. If i have 2 authors i add two name’s authors but picture of first author only.  
i search one best solution . because i call same range after for others informations. i wish call this range only one upon time for best performance or best practice 😉  
i use this code pour create this situation :

> **my code :)**
>
> {{ define “main” }}
> 
> {{ range .Pages }} 
> 
> ```
> <!-- top image carte -->
> <div>
> <img src="{{with .Params.featured_image}}{{.}}{{else}}{{ .Site.Params.featured_image }}{{end}}" alt=""
> class="object-fill w-full h-40">
> </div>
> <div class=" m-2 text-justify text-sm ">
> 
> <div class="flex flex-wrap items-center -mt-8 pb-3 ">
> <img class="block h-8 w-8 rounded-full bg-white mt-1 mr-2 ml-3 border-2 border-white "
> src='{{ range first 1 .Params.authors }}
> {{with $.Site.GetPage "taxonomyTerm" (printf "authors/%s" (urlize .)) }}{{ with .Params.photo }}{{ . }}{{ else }}{{ .Site.Params.authorimage }}{{ end }}{{ end }}{{ end }}'
> alt="image de l'auteur">
> {{ range .Params.authors }}
> {{with $.Site.GetPage "taxonomyTerm" (printf "authors/%s" (urlize .)) }}
> <a href='{{ .Permalink }}'><span
> class="block text-lg font-bold text-white">{{ with .Params.name }}{{ . }}{{else}}{{ .Site.Params.author }}{{end}}{{ end }}{{ end }}</span></a>
> 
> </div>
> <div class=" ">
> <p class=" text-right -mt-4 text-xs"> <i class=" mr-1 far fa-calendar-alt"></i>
> 
> <!-- date en Fr via data/mois.yaml merci https://www.christopheducamp.com/ ;) -->
> <time class="post-date dt-published"
> datetime='{{ .Date.Format "2006-01-02T15:04:05Z07:00" | safeHTML }}'>{{ .Date.Day }}
> {{ index $.Site.Data.mois (printf "%d" .Date.Month) }} {{ .Date.Year }}</time> </p>
> 
> <p class=" text-right text-xs"> <i class=" mr-1 fas fa-clock"></i>
> {{.ReadingTime }} minutes
> </p>
> <h2 class=" font-bold mb-1 text-center"> <a href="{{ .Permalink }}">{{ .Title }}</a> </h2>
> 
> <p class=" h-32 md:h-40 text-xs p-3"> {{ with .Params.description }}
> {{ . }}
> {{ else }}
> {{ .Summary }}
> {{ end }}
> </p>
> 
> </div>
> 
> </div>
> <a href="{{ .Permalink }}">
> <div class=" absolute bottom-0 w-full py-2 text-center bg-blue-500 hover:bg-blue-900 text-white ">
> Lire
> </div>
> </a>
> 
> </div> {{ end }} {{ end }}
> 
> ```

---

<div class="post-metadata">

**Author:** ![maiki](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/maiki/32/16384_2.png) [@maiki](https://discourse.gohugo.io/u/maiki)\
**Post date:** [April 3, 2020, 4:11am UTC](https://discourse.gohugo.io/t/range-and-index/24421/2 "2020-04-03T04:11:48Z")

</div>

#support is for technical support questions.

---

<div class="post-metadata">

**Author:** ![maiki](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/maiki/32/16384_2.png) [@maiki](https://discourse.gohugo.io/u/maiki)\
**Post date:** [April 3, 2020, 4:11am UTC](https://discourse.gohugo.io/t/range-and-index/24421/3 "2020-04-03T04:11:55Z")

</div>


