mirror of
https://github.com/tiennm99/HugoBlox-kit.git
synced 2026-10-13 00:14:05 +00:00
fix: workaround Hugo Page.GetTerms bug
Hugo bug causes authors not to be listed in the order in which they were defined in the front matter.
See Hugo bug report at https://github.com/gohugoio/hugo/issues/7213
This commit partially reverts f78feefee9 where the code was refactored to use Page.GetTerms for authors.
This commit is contained in:
1 parent
f78feefee9
commit
48b39f8550
1 file changed
+6
-7
@@ -1,18 +1,17 @@
|
||||
{{/* Display author list. */}}
|
||||
|
||||
{{- $taxonomy := "authors" }}
|
||||
{{ if .Param $taxonomy }}
|
||||
{{ with .Param $taxonomy }}
|
||||
{{ $link_authors := site.Params.link_authors | default true }}
|
||||
{{ range $index, $value := (.GetTerms $taxonomy) }}
|
||||
{{- /* Check if a profile was created for this user. */ -}}
|
||||
{{- $profile_page := isset .Page.Params "superuser" -}}
|
||||
|
||||
{{ range $index, $name_raw := . }}
|
||||
{{- $profile_page := site.GetPage (printf "/%s/%s" $taxonomy .) -}}
|
||||
{{- $name := $profile_page.Title | default $name_raw -}}
|
||||
{{- if gt $index 0 }}, {{ end -}}
|
||||
<span>
|
||||
{{- if and $profile_page $link_authors -}}
|
||||
<a href="{{.RelPermalink}}">{{ .LinkTitle }}</a>
|
||||
<a href="{{$profile_page.RelPermalink}}">{{$name}}</a>
|
||||
{{- else -}}
|
||||
{{ .LinkTitle }}
|
||||
{{$name}}
|
||||
{{- end -}}
|
||||
</span>
|
||||
{{- end -}}
|
||||
|
||||
Reference in new issue
Block a user