{{ define "main" }} {{ $pages := .Pages }} {{ with $.Site.Params.language_alternatives }} {{ range . }} {{ with (where $.Translations ".Lang" . ) }} {{ $p := index . 0 }} {{ $pages = $pages | lang.Merge $p.Pages }} {{ end }} {{ end }} {{ end }} {{ $featured := (where $pages "Params.featured" true).ByWeight | first 4 }}
{{ range $featured }} {{ template "case-study-featured-block" (dict "ctx" $ "page" .) }} {{ end }}
{{ $featuredVideos := where .Pages ".Params.video" "!=" nil }} {{ with $featuredVideos }} {{ with index $featuredVideos 0 }}

"{{ .Params.quote | html }}"

{{ $img := .Resources.GetMatch "video.png" }} {{ $small := .Resources.GetMatch "**small*.png" }} {{ with $small }}{{ .Title }}{{ end }}
{{ end }} {{ end }}

{{ .Title }}

{{ .Content }} {{ end }} {{ define "case-study-featured-block" }} {{ $isForeignLanguage := (ne .page.Lang .ctx.Lang)}} {{ $logo := .page.Resources.GetMatch "**{feature,logo}*.png" }}
{{ with $logo }}{{ .Title }}{{ end }}

"{{ .page.Params.quote | html }}"

{{ T "main_read_about"}} {{ .page.LinkTitle }}
{{ end }}