{{/* Hugo Blox: Logos Block */}} {{/* Documentation: https://hugoblox.com/blocks/ */}} {{/* License: https://github.com/HugoBlox/kit/blob/main/LICENSE.md */}} {{/* Initialise */}} {{ $page := .wcPage }} {{ $block := .wcBlock }} {{ $content := $block.content }} {{ if not (reflect.IsMap $content) }}{{ $content = dict }}{{ end }} {{ $design := $block.design }} {{ if not (reflect.IsMap $design) }}{{ $design = dict }}{{ end }} {{ $display_mode := "grid" }} {{ $display_raw := index $design "display_mode" }} {{ if eq (printf "%T" $display_raw) "string" }} {{ $display_mode = lower (strings.TrimSpace $display_raw) }} {{ end }} {{ if not (in (slice "grid" "carousel" "marquee") $display_mode) }} {{ $display_mode = "grid" }} {{ end }} {{ $show_pattern := partial "functions/coerce_bool" (dict "value" (index $design "show_pattern") "default" false) }} {{ $title := "" }} {{ with index $content "title" }}{{ $title = printf "%v" . | emojify | $page.RenderString }}{{ end }} {{ $subtitle := "" }} {{ with index $content "subtitle" }}{{ $subtitle = printf "%v" . | emojify | $page.RenderString }}{{ end }} {{ $text := "" }} {{ with index $content "text" }}{{ $text = printf "%v" . | emojify | $page.RenderString }}{{ end }} {{ $logos_raw := index $content "logos" }} {{ $logos := slice }} {{ if reflect.IsSlice $logos_raw }}{{ $logos = $logos_raw }}{{ end }} {{ $logo_folder := "" }} {{ $logo_folder_raw := index $content "logo_folder" }} {{ if eq (printf "%T" $logo_folder_raw) "string" }}{{ $logo_folder = strings.TrimSpace $logo_folder_raw }}{{ end }} {{ $cta := index $content "cta" }} {{ if not (reflect.IsMap $cta) }}{{ $cta = dict }}{{ end }} {{ $cta_text := "" }} {{ with index $cta "text" }}{{ $cta_text = strings.TrimSpace (printf "%v" .) }}{{ end }} {{ $cta_url := "" }} {{ with index $cta "url" }}{{ $cta_url = strings.TrimSpace (printf "%v" .) }}{{ end }} {{ $cta_icon := "" }} {{ with index $cta "icon" }}{{ $cta_icon = printf "%v" . }}{{ end }}
{{ . }}
{{ end }} {{ with $text }}{{ . }}
{{ end }}