{{/* Hugo Blox: Contact Info Block */}} {{/* Documentation: https://hugoblox.com/blocks/ */}} {{/* License: https://github.com/HugoBlox/kit/blob/main/LICENSE.md */}} {{/* Initialise */}} {{ $page := .wcPage }} {{ $block := .wcBlock }} {{/* Enable Alpine.js for copy-to-clipboard functionality */}} {{ $page.Store.Set "has_alpine" true }} {{ $title := $block.content.title | default (i18n "block_contact_title" | default "Contact Us") | emojify | $page.RenderString }} {{ $subtitle := $block.content.subtitle | emojify | $page.RenderString }} {{/* Check if Visit Us card has content */}} {{ $has_visit_content := or $block.content.address $block.content.office_hours $block.content.map_url }} {{/* Check if Connect card has content - fallback to author profile if no email/social */}} {{ $author := $block.content.username | default "me" }} {{ $profile := partial "functions/get_author_profile" $author }} {{ $email := $block.content.email | default $profile.email }} {{ $phone := $block.content.phone }} {{ $social := $block.content.social | default $profile.links }} {{ $has_connect_content := or $email $phone $social $block.content.prospective }} {{/* Determine grid layout - single column centered if only one card */}} {{ $grid_class := "grid-cols-1 lg:grid-cols-2" }} {{ $card_max_width := "" }} {{ $is_single_card := false }} {{ if and $has_visit_content (not $has_connect_content) }} {{ $grid_class = "grid-cols-1" }} {{ $card_max_width = "max-w-3xl mx-auto" }} {{ $is_single_card = true }} {{ else if and $has_connect_content (not $has_visit_content) }} {{ $grid_class = "grid-cols-1" }} {{ $card_max_width = "max-w-3xl mx-auto" }} {{ $is_single_card = true }} {{ end }}
{{/* Section Header */}}
{{ with $title }}

{{ . }}

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

{{ . }}

{{ end }}
{{/* Contact Cards Grid */}}
{{/* Visit Us Card - Only show if has content */}} {{ if $has_visit_content }}
{{ partial "functions/get_icon" (dict "name" "hero/map-pin" "attributes" "class=\"w-6 h-6 text-primary-600 dark:text-primary-400\"") }}

{{ $block.content.visit_title | default (i18n "block_contact_visit_title" | default "Visit Us") }}

{{ with $block.content.address }}
{{ range .lines }}

{{ . }}

{{ end }}
{{ end }} {{ with $block.content.office_hours }}

{{ i18n "block_contact_office_hours" | default "Office Hours" }}

{{ range . }}

{{ . }}

{{ end }}
{{ end }} {{ with $block.content.map_url }} {{ partial "functions/get_icon" (dict "name" "hero/map" "attributes" "class=\"w-5 h-5 mr-2\"") }} {{ i18n "block_contact_view_on_map" | default "View on Map" }} {{ end }}
{{ end }} {{/* Connect Card - Only show if has content */}} {{ if $has_connect_content }}
{{/* Filter social links - remove mailto if email is shown separately */}} {{ $filtered_social := slice }} {{ range $social }} {{ if not (hasPrefix .url "mailto:") }} {{ $filtered_social = $filtered_social | append . }} {{ end }} {{ end }} {{ if $is_single_card }} {{/* Single card layout - horizontal on desktop */}}
{{/* Left: Email & CTA */}}

{{ $block.content.connect_title | default (i18n "block_contact_connect_title" | default "Let's Connect") }}

{{ $block.content.text | default "I'm always open to discussing new projects, opportunities, or just having a chat." }}

{{ with $email }} {{/* Email with click-to-copy */}}
{{/* Toast notification */}}
✓ Copied to clipboard!
{{/* Primary CTA Button */}} {{ partial "functions/get_icon" (dict "name" "hero/paper-airplane" "attributes" "class=\"w-5 h-5 mr-2\"") }} Send a message {{ end }} {{ with $phone }}
{{ partial "functions/get_icon" (dict "name" "hero/phone" "attributes" "class=\"w-6 h-6 text-primary-600 dark:text-primary-400\"") }}

Call me

{{ . }}

{{ end }}
{{/* Right: Social Links */}} {{ with $filtered_social }}

{{ i18n "block_contact_follow_me" | default "Find me on" }}

{{ end }}
{{ else }} {{/* Standard card layout (when shown alongside Visit Us) */}}
{{ partial "functions/get_icon" (dict "name" "hero/chat-bubble-left-right" "attributes" "class=\"w-6 h-6 text-primary-600 dark:text-primary-400\"") }}

{{ $block.content.connect_title | default (i18n "block_contact_connect_title" | default "Connect") }}

{{ end }} {{/* Prospective Members - shown in both layouts */}} {{ with $block.content.prospective }}

{{ .title | default (i18n "block_contact_prospective_title" | default "Prospective Members") }}

{{ .text }}

{{ with .button }} {{ partial "functions/get_icon" (dict "name" "hero/user-plus" "attributes" "class=\"w-5 h-5 mr-2\"") }} {{ .text }} {{ end }}
{{ end }}
{{ end }}
{{/* Optional Map Embed */}} {{ with $block.content.map_embed }}
{{ . | safeHTML }}
{{ end }} {{/* Contact Form (optional) */}} {{ if $block.content.show_form }}

{{ i18n "block_contact_form_title" | default "Send us a Message" }}

{{ end }}