fix page params loop

This commit is contained in:
Robert Kaussow 2020-07-06 21:59:33 +02:00
parent 8e2a80c8bd
commit ae40ac5bcb
No known key found for this signature in database
GPG Key ID: 65362AE74AF98B61

View File

@ -22,8 +22,11 @@
</span> </span>
</span> </span>
{{ range $i, $name := sort .Params.Authors }} {{ $.Scratch.Set "author-counter" 0 }}
{{ $author := index $.Site.Data.authors $name }} {{ with .Params.authors }}
{{ range sort . }}
{{ $i := $.Scratch.Get "author-counter" }}
{{ $author := index $.Site.Data.authors . }}
{{ with $.Site.GetPage (printf "/authors/%s" $author.name | urlize) }} {{ with $.Site.GetPage (printf "/authors/%s" $author.name | urlize) }}
{{ if eq $i 0 }} {{ if eq $i 0 }}
<span class="no-wrap"> <span class="no-wrap">
@ -36,9 +39,15 @@
</span> </span>
{{ end }} {{ end }}
{{ end }} {{ end }}
{{ $.Scratch.Set "author-counter" (add ($i) 1) }}
{{ end }}
{{ end }} {{ end }}
{{ range $i, $name := sort .Params.Tags }} {{ $.Scratch.Set "tag-counter" 0 }}
{{ with .Params.tags }}
{{ range sort . }}
{{ $i := $.Scratch.Get "tag-counter" }}
{{ $name := . }}
{{ if eq $i 0 }} {{ if eq $i 0 }}
<span class="no-wrap"> <span class="no-wrap">
<svg class="icon menu"><use xlink:href="#tags"></use></svg> <svg class="icon menu"><use xlink:href="#tags"></use></svg>
@ -51,6 +60,8 @@
{{ if eq $i 0 }} {{ if eq $i 0 }}
</span> </span>
{{ end }} {{ end }}
{{ $.Scratch.Set "tag-counter" (add ($i) 1) }}
{{ end }}
{{ end }} {{ end }}
</footer> </footer>
</article> </article>