You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
864 B
HTML

{{ $page := . }}
{{ $result := slice }}
{{ if $page.Params.authors }}
{{ range $page.Params.authors }}
{{ $id := "" }}
{{ $name := "" }}
{{ if reflect.IsMap . }}
{{ with .author }}
{{ $id = . }}
{{ $name = (index site.Params.authors .).name }}
{{ else }}
{{ $name = .name }}
{{ end }}
{{ else }}
{{ $id = . }}
{{ $name = (index site.Params.authors .).name }}
{{ end }}
{{ $result = $result | append (dict "id" $id "name" $name) }}
{{ end }}
{{ else if site.Params.authors }}
{{ range $k, $v := site.Params.authors }}
{{ if eq $v.default true }}
{{ $result = $result | append (dict "id" $k "name" $v.name) }}
{{ end }}
{{ end }}
{{ end }}
{{ return $result }}