{{- define "main" -}} {{- $image := .Resources.GetMatch "*featured*" -}} {{- with .Params.heroImage -}} {{- $image = $.Page.Resources.GetMatch "*hero*" -}} {{- end -}} {{- $imagesrc := "" -}} {{- with $image -}} {{- $image = .Resize "600x" -}} {{- $imagesrc = .RelPermalink -}} {{- end -}} {{- $bkImageSnap := "true" -}} {{- $relatedContentClass := .Params.relatedcontentclass -}} {{- if eq .Params.hero "true" -}} {{- if eq .Params.heroStyle "simple" -}}

{{- .Title -}}

{{- .Description -}}
{{- else -}}
{{- with $imagesrc -}} Section background image {{- end -}}

{{- .Title -}}

{{- .Description -}}

{{- end -}} {{- end -}} {{- if eq .Params.breadcrumb "true" -}}
{{- end -}} {{- with .Params.contentlayout -}} {{- if eq "style1" . -}}
{{- with $.Page.Params.subtitle -}}

{{- . -}}

{{- end -}}
{{- $.Page.Content -}}
{{- end -}} {{- if eq "style2" . -}}
{{- with $.Page.Params.subtitle -}}

{{- . -}}

{{- end -}} {{- $.Page.Content -}}
{{- end -}} {{- else -}}
{{- .Content -}}
{{- end -}} {{- $ctx := . -}} {{- with .Params.id -}} {{- partial . $ctx -}} {{- end -}} {{- if eq .Params.childSections "true" -}} {{- with $sections := .Sections -}}
{{- range $sections -}} {{- partial "sub-section" (dict "ctx" . "relatedContentClass" $relatedContentClass) -}} {{- end -}}
{{- end -}} {{- end -}} {{- $pages := where .Site.Pages "Section" .CurrentSection -}} {{- if eq .Params.regularPages "true" -}}
{{ range .RegularPages }} {{- partial "sub" . -}} {{- end -}}
{{- end -}} {{- if or (eq .Params.relatedbycategory "true") (eq .Params.relatedbytag "true") -}}
{{- with .Params.relatedTitle -}}{{- . -}}{{- else -}}Related {{- end -}}
{{- if eq .Params.relatedbycategory "true" -}} {{- partial "related-by-categories" . -}} {{- end -}} {{- if eq .Params.relatedbytag "true" -}} {{- partial "related-by-tags" . -}} {{- end -}}
{{- end -}} {{- if eq .Params.prevnext "true" -}} {{- partial "prev-next" . -}} {{- end -}}
{{- end -}}