mirror of
https://github.com/thegeeklab/hugo-geekblog.git
synced 2024-11-25 06:20:40 +00:00
fix page params loop
This commit is contained in:
parent
8e2a80c8bd
commit
ae40ac5bcb
@ -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>
|
||||||
|
Loading…
Reference in New Issue
Block a user