{{- $siteAuthors := .Site.Params.authors -}} {{- $pageAuthors := .Params.authors -}} {{- if (or (not $pageAuthors) (eq (len $pageAuthors) 0)) -}} {{- $pageAuthors = slice (index $siteAuthors 0).name -}} {{- else if not (reflect.IsSlice $pageAuthors) -}} {{- $pageAuthors = slice $pageAuthors -}} {{- end -}} {{- $authorLinks := slice -}} {{- range $pageAuthors -}} {{- $matchedAuthor := index (where $siteAuthors "name" .) 0 -}} {{- if $matchedAuthor -}} {{- $authorLink := printf "%s" $matchedAuthor.url $matchedAuthor.name -}} {{- $authorLinks = $authorLinks | append $authorLink -}} {{- else -}} {{- $authorLinks = $authorLinks | append . -}} {{- end -}} {{- end -}} {{- delimit $authorLinks ", " | safeHTML -}}