# Questions for use range

**URL:** <https://discourse.gohugo.io/t/questions-for-use-range/24439>\
**Category:** support\
**Created:** [April 3, 2020, 1:12pm UTC](https://discourse.gohugo.io/t/questions-for-use-range/24439 "2020-04-03T13:12:46Z")\
**Posts on this page:** 4\
**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 3, 2020, 1:12pm UTC](https://discourse.gohugo.io/t/questions-for-use-range/24439/1 "2020-04-03T13:12:47Z")

</div>

hi i have a question

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 😉  
Could you help me please ?  
i use this code pour create this situation

{{ define “main” }}

{{ range .Pages }}

```
<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>

```

 {{ 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 5, 2020, 7:35am UTC](https://discourse.gohugo.io/t/questions-for-use-range/24439/2 "2020-04-05T07:35:35Z")

</div>

> [@Ptitnux](#):
>
> Could you help me please ?

It is not clear what your question is. Please share a repo and explain the issue you are having in more detail.

---

<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 5, 2020, 8:28am UTC](https://discourse.gohugo.io/t/questions-for-use-range/24439/3 "2020-04-05T08:28:25Z")

</div>

ok…  
hi  
if i have two or many authors for one post :

i enter one the range one uponce  
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”\>

and second uponce for :  
{{ range .Params.authors }}  
{{with $.Site.GetPage “taxonomyTerm” (printf “authors/%s” (urlize .)) }}  
{{ with .Params.name }}{{ . }}{{else}}{{ .Site.Params.author }}{{end}}{{ end }}{{ end }}

i search solution for call one only uponce this range for good power 🙂

---

<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 7, 2020, 8:28am UTC](https://discourse.gohugo.io/t/questions-for-use-range/24439/4 "2020-04-07T08:28:26Z")

</div>

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