{{- define "main" -}}
{{- $heroImage := "" -}}
{{- $heroInlineSvg := "" -}}
{{- with .Params.hero.image -}}
{{- $match := $.Resources.GetMatch . -}}
{{- if not $match -}}
{{- $match = $.Resources.GetMatch (printf "img/%s" .) -}}
{{- end -}}
{{- with $match -}}
{{- $heroImage = .RelPermalink -}}
{{- end -}}
{{- end -}}
{{- with .Params.hero.inline_svg -}}
{{- $match := $.Resources.GetMatch . -}}
{{- if not $match -}}
{{- $match = $.Resources.GetMatch (printf "img/%s" .) -}}
{{- end -}}
{{- with $match -}}
{{- $heroInlineSvg = .Content -}}
{{- end -}}
{{- end -}}
{{- with .Params.hero.tags -}}
{{- end -}}
{{ with .Params.hero.title }}{{ . }}{{ else }}{{ .Title }}{{ end }}
{{- with .Params.hero.deck -}}
{{ . | markdownify }}
{{- end -}}
{{- if and (not .Params.hero.deck) .Summary -}}
{{ .Summary | markdownify }}
{{- end -}}
{{- with .Params.study -}}
{{- end -}}
{{- with $heroInlineSvg -}}
{{ . | safeHTML }}
{{- end -}}
{{- with .Params.study.toc -}}
{{- end -}}