mirror of
https://github.com/thegeeklab/hugo-geekblog.git
synced 2024-11-25 22:40:39 +00:00
remove global scratch
This commit is contained in:
parent
77b893063d
commit
67544294b9
@ -22,10 +22,9 @@
|
|||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
{{ $.Scratch.Set "author-counter" 0 }}
|
{{ $ac := 0 }}
|
||||||
{{ with .Params.authors }}
|
{{ with .Params.authors }}
|
||||||
{{ range sort . }}
|
{{ range sort . }}
|
||||||
{{ $ac := $.Scratch.Get "author-counter" }}
|
|
||||||
{{ $author := index $.Site.Data.authors . }}
|
{{ $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 $ac 0 }}
|
{{ if eq $ac 0 }}
|
||||||
@ -37,14 +36,13 @@
|
|||||||
{{ template "post-author" dict "name" $author.name "page" . }}
|
{{ template "post-author" dict "name" $author.name "page" . }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ $.Scratch.Set "author-counter" (add $ac 1) }}
|
{{ add $ac 1 }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{ $.Scratch.Set "tag-counter" 0 }}
|
{{ $tc := 0 }}
|
||||||
{{ with .Params.tags }}
|
{{ with .Params.tags }}
|
||||||
{{ range sort . }}
|
{{ range sort . }}
|
||||||
{{ $tc := $.Scratch.Get "tag-counter" }}
|
|
||||||
{{ $name := . }}
|
{{ $name := . }}
|
||||||
{{ with $.Site.GetPage (printf "/tags/%s" $name | urlize) }}
|
{{ with $.Site.GetPage (printf "/tags/%s" $name | urlize) }}
|
||||||
{{ if eq $tc 0 }}
|
{{ if eq $tc 0 }}
|
||||||
@ -56,7 +54,7 @@
|
|||||||
{{ template "post-tag" dict "name" $name "page" . }}
|
{{ template "post-tag" dict "name" $name "page" . }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ $.Scratch.Set "tag-counter" (add $tc 1) }}
|
{{ add $tc 1 }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</footer>
|
</footer>
|
||||||
|
Loading…
Reference in New Issue
Block a user