{{ define "header" }} {{ $author := index .Site.Data.authors ( .Params.author | default "" ) }} {{ $coauthors := split ( .Params.coauthor | default "" ) "," }}
{{ .Title }}
{{ if and $author (gt (len $coauthors) 1) }}

Written by {{ $author.name }} {{/* if len($coauthors) < 2 */}} {{ if lt (len $coauthors) 2 }} {{ $coauthor := index .Site.Data.authors ( .Params.coauthor | default "" ) }} and {{ $coauthor.name }} {{ else }} in collaboration with {{ $length := len $coauthors }} {{ range $i, $name := $coauthors }} {{ $coauthor := index $.Site.Data.authors $name }} {{/* if i == length -1 */}} {{ if eq $i (sub $length 1) }} and {{ end }} {{ $coauthor.name }}{{- if lt $i (sub $length 1) -}},{{- end -}} {{/* if i < length - 1 */}} {{ end }} {{ end }} on {{ .Date.Format $.Site.Params.fmt.Date }}

{{ else if $author }}
Written by {{ $author.name }} on {{ .Date.Format $.Site.Params.fmt.Date }}
{{ else }}
Written on {{ .Date.Format $.Site.Params.fmt.Date }}
{{ end }}
{{ end }} {{ define "main" }}

{{ .Content }}
{{ if .Params.forum }}
Continue the discussion on our forums.
{{ end }} {{ end }} {{ define "css" }} {{ end }} {{ define "scripts" }} {{ end }}