{{/* Used for the Client&Works section in the homepage */}} {{/* If some content is missing/not displayed, check the images for the client/work */}} {{- $contextType := printf "%T" . -}} {{- $isShortcode := (eq $contextType "*hugolib.ShortcodeWithPage") -}} {{/* --------------------------------------------------------------------------- SECTION TITLE --------------------------------------------------------------------------- */}} {{- $sectionTitle := "" -}} {{- if $isShortcode -}} {{- $sectionTitle = .Get "title" -}} {{- else -}} {{- $sectionTitle = i18n "client_work_title" -}} {{- end -}} {{/* --------------------------------------------------------------------------- CLIENTS --------------------------------------------------------------------------- */}} {{- $clients := slice -}} {{- if not $isShortcode -}} {{- $baseLangSite := .Sites.Default -}} {{- $clients = (where .Site.RegularPages.ByDate.Reverse "Type" "client-work" | lang.Merge (where $baseLangSite.RegularPages.ByDate.Reverse "Type" "client-work") ) -}} {{- else -}} {{- $clients = (where .Site.RegularPages.ByDate.Reverse "Type" "client-work") -}} {{- end -}} {{/* --------------------------------------------------------------------------- PROJECTS --------------------------------------------------------------------------- */}} {{- $projects := (where .Site.RegularPages.ByDate.Reverse "Type" "projects") -}} {{/* sectionId: Optional argument to override the default HTML id for this section. If not provided, the default id is used. */}} {{ $sectionId := "client-and-work-section" }} {{ with .Get "sectionId" }} {{ $sectionId = . }} {{ end }}

{{ $sectionTitle }}

{{/* Projects */}} {{ range $index, $element := $projects }} {{ $is_even := eq (mod $index 2) 0 }} {{ with $element }}
{{ if $is_even }}

{{ .Params.title }}

{{ .Page.Content }}
{{ .Params.button.btnText }}
{{ partial "lazypicture" (dict "src" .Params.image.src "scale" .Params.image.scale "class" "picture-works even")}}
{{ else }}
{{ partial "lazypicture" (dict "src" .Params.image.src "scale" .Params.image.scale "class" "picture-works odd")}}

{{ .Params.title }}

{{ .Page.Content }}
{{ .Params.button.btnText }}
{{ end }}
{{ end }} {{ end }}