mirror of
https://github.com/thegeeklab/hugo-geekblog.git
synced 2024-11-22 05:00:39 +00:00
fix page params loop
This commit is contained in:
parent
8e2a80c8bd
commit
ae40ac5bcb
@ -22,8 +22,11 @@
|
||||
</span>
|
||||
</span>
|
||||
|
||||
{{ range $i, $name := sort .Params.Authors }}
|
||||
{{ $author := index $.Site.Data.authors $name }}
|
||||
{{ $.Scratch.Set "author-counter" 0 }}
|
||||
{{ with .Params.authors }}
|
||||
{{ range sort . }}
|
||||
{{ $i := $.Scratch.Get "author-counter" }}
|
||||
{{ $author := index $.Site.Data.authors . }}
|
||||
{{ with $.Site.GetPage (printf "/authors/%s" $author.name | urlize) }}
|
||||
{{ if eq $i 0 }}
|
||||
<span class="no-wrap">
|
||||
@ -36,9 +39,15 @@
|
||||
</span>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ $.Scratch.Set "author-counter" (add ($i) 1) }}
|
||||
{{ 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 }}
|
||||
<span class="no-wrap">
|
||||
<svg class="icon menu"><use xlink:href="#tags"></use></svg>
|
||||
@ -51,6 +60,8 @@
|
||||
{{ if eq $i 0 }}
|
||||
</span>
|
||||
{{ end }}
|
||||
{{ $.Scratch.Set "tag-counter" (add ($i) 1) }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</footer>
|
||||
</article>
|
||||
|
Loading…
Reference in New Issue
Block a user