1234567891011121314151617181920212223 |
- {{/* 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" (urlize $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 }}
|