{{/* Hugo Blox: Logos Block */}} {{/* Documentation: https://hugoblox.com/blocks/ */}} {{/* License: https://github.com/HugoBlox/hugo-blox-builder/blob/main/LICENSE.md */}} {{/* Initialise */}} {{ $page := .wcPage }} {{ $block := .wcBlock }} {{ $display_mode := $block.design.display_mode | default "grid" }} {{ $title := $block.content.title | emojify | $page.RenderString }} {{ $subtitle := $block.content.subtitle | emojify | $page.RenderString }} {{ $text := $block.content.text | emojify | $page.RenderString }}
{{/* Background Pattern */}} {{ if $block.design.show_pattern }}
{{ end }}
{{/* Section Header */}}
{{ with $title }}

{{ . }}

{{ end }} {{ with $subtitle }}

{{ . }}

{{ end }} {{ with $text }}

{{ . }}

{{ end }}
{{/* Grid Display Mode */}} {{ if eq $display_mode "grid" }}
{{/* Logo Items from Data */}} {{ if $block.content.logos }} {{ range $block.content.logos }} {{ end }} {{/* Logo Images from Folder (Legacy Support) */}} {{ else if $block.content.logo_folder }} {{ $images := resources.Match (printf "media/%s/*.{svg,png,jpg,webp}" $block.content.logo_folder) }} {{ range $images }}
{{ $image := . }} {{ $isSVG := eq $image.MediaType.SubType "svg" }} {{ if not $isSVG }} {{ $image = $image.Fit "280x140 webp" }} {{ end }} Partner logo
{{ end }} {{ end }}
{{/* Carousel Display Mode */}} {{ else if eq $display_mode "carousel" }}
{{/* Duplicate items for continuous scroll */}} {{ $items := slice }} {{ if $block.content.logos }} {{ $items = $block.content.logos }} {{ else if $block.content.logo_folder }} {{ $images := resources.Match (printf "media/%s/*.{svg,png,jpg,webp}" $block.content.logo_folder) }} {{ range $images }} {{ $items = $items | append (dict "image" .Name) }} {{ end }} {{ end }} {{/* First set of logos */}} {{ range $items }}
{{ if .image }} {{ $img := resources.Get (printf "media/%s" .image) }} {{ if $img }} {{ $isSVG := eq $img.MediaType.SubType "svg" }} {{ if not $isSVG }} {{ $img = $img.Fit "280x140 webp" }} {{ end }} {{ .name | default {{ end }} {{ end }}
{{ end }} {{/* Duplicate for seamless loop */}} {{ range $items }}
{{ if .image }} {{ $img := resources.Get (printf "media/%s" .image) }} {{ if $img }} {{ $isSVG := eq $img.MediaType.SubType "svg" }} {{ if not $isSVG }} {{ $img = $img.Fit "280x140 webp" }} {{ end }} {{ .name | default {{ end }} {{ end }}
{{ end }}
{{/* Marquee Display Mode */}} {{ else if eq $display_mode "marquee" }}
{{ if $block.content.logos }} {{ range $block.content.logos }}
{{ if .image }} {{ $img := resources.Get (printf "media/%s" .image) }} {{ if $img }} {{ $isSVG := eq $img.MediaType.SubType "svg" }} {{ if not $isSVG }} {{ $img = $img.Fit "280x140 webp" }} {{ end }} {{ .name | default {{ end }} {{ end }}
{{ end }} {{ end }}
{{ end }} {{/* Call to Action */}} {{ with $block.content.cta }} {{ end }}
{{/* Custom CSS for Animations */}}