{{- define "main" -}} {{- $posts := where .Site.RegularPages "Section" "posts" -}} {{- $featured := where $posts "Params.featured" true -}} {{- $hero := index $featured 0 -}} {{- $secondary := after 1 $featured | first 3 -}} {{- $latest := complement $featured $posts -}} {{- with $hero -}}
{{- $heroBanner := .Resources.GetMatch "banner.png" -}} {{- if not $heroBanner -}}{{- $heroBanner = .Resources.GetMatch "banner.*" -}}{{- end -}} {{- $heroBannerSrc := "" -}} {{- with $heroBanner }}{{ $heroBannerSrc = .RelPermalink }}{{ else }}{{ with $.Params.background }}{{ $heroBannerSrc = .src }}{{ else }}{{ with $.Params.banner }}{{ $heroBannerSrc = .src }}{{ end }}{{ end }}{{ end -}} {{- with $heroBannerSrc -}}
{{- end -}}
Featured Drop {{- with .Params.categories -}} {{- range first 1 . -}} {{ . }} {{- end -}} {{- end -}}

{{- .Title -}}

{{- .Description -}}

View Editorial {{ partial "icon.html" "arrow-right" }} {{- with .Params.author -}} {{- $author := site.GetPage (printf "authors/%s" .) -}} {{- with $author -}}
{{- $avRes := .Resources.GetMatch "avatar.*" -}} {{- $avSrc := "" -}} {{- with $avRes }}{{ $avSrc = .RelPermalink }}{{ else }}{{ with $author.Params.avatar }}{{ $avSrc = . }}{{ end }}{{ end -}} {{- with $avSrc -}} {{ $author.Params.name | default $author.Title }} {{- end -}} By {{ .Params.name | default .Title }}
{{- end -}} {{- end -}}
{{- end -}} {{- with $secondary -}}
Also Featured
{{- range . -}} {{- partial "post-card-large.html" . -}} {{- end -}}
{{- end -}}

LATEST DROPS

All posts {{ partial "icon.html" "arrow-right" }}
{{- range first 8 $latest -}} {{- partial "post-card.html" . -}} {{- end -}}
{{- if gt (len $latest) 8 -}}
View All {{ len $latest }} Posts {{ partial "icon.html" "arrow-right" }}
{{- end -}}
About the Magazine

{{ .Site.Params.description }}

About the magazine {{ partial "icon.html" "arrow-right" }}
{{- end -}}