{{/* If `authors` is set and is not empty. */}}
{{ if $.Params.authors }}
{{ $authorLen := len $.Params.authors }}
{{ if gt $authorLen 0 }}
  {{ range $k, $v := $.Params.authors -}}
    <span itemscope itemprop="author" itemtype="http://schema.org/Person">
      <span itemprop="name">
        {{ $link := ($.Site.GetPage (printf "/authors/%s" $v)).RelPermalink }}

      {{ $person_page_path := (printf "/author/%s" (urlize $v)) }}
      {{ $person_page := $.Site.GetPage $person_page_path }}
      {{ if $person_page }}
        {{ $person := $person_page.Params }}
        {{- printf "<a href=\"%s\">%s</a>" $link $person.name | safeHTML -}}
      {{- else -}}
                {{- printf "<a href=\"%s\">%s</a>" $link ($v | markdownify) | safeHTML -}}
      {{- end -}}
      </span>{{- /* This comment removes whitespace */ -}}
    </span>
    {{- if lt $k (sub $authorLen 1) -}}, {{ end }}
  {{ end }}
{{ end }}
{{ end }}
