{{ 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 }}
{{ partial "deprecation-warning.html" . }}
{{ range $featured }} {{ template "case-study-featured-block" (dict "ctx" $ "page" .) }} {{ end }}
{{ $featuredVideos := where .Pages ".Params.video" "!=" nil }} {{ with $featuredVideos }} {{ with index $featuredVideos 0 }} {{ $altText := .LinkTitle }}

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

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

{{ .Title }}

{{ range $pages.ByTitle }} {{ $logo := .Resources.GetMatch "**{feature,logo}*.svg" }} {{ if not $logo }} {{ $logo = .Resources.GetMatch "**logo*.png" }} {{ end }} {{ $p := . }} {{ with $logo }} {{ $p.LinkTitle }} {{ else }} {{ errorf "Case Studies: Missing logo for %s. Put a PNG or SVG with the word 'logo' in the filename into %q" $p.LinkTitle $p.File.Dir }} {{ end }} {{ end }} {{ T
{{ .Content }} {{ end }} {{ define "case-study-featured-block" }} {{ $isForeignLanguage := (ne .page.Lang .ctx.Lang)}} {{ $logo := .page.Resources.GetMatch "**{feature,logo}*.svg" }} {{ $altText := .page.LinkTitle}}
{{ with $logo }}{{ $altText }}{{ end }}

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

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