{{/* Hugo Blox: Contact */}} {{/* Documentation: https://hugoblox.com/blocks/ */}} {{/* License: https://github.com/HugoBlox/hugo-blox-builder/blob/main/LICENSE.md */}} {{/* Initialise */}} {{ $page := .wcPage }} {{ $block := .wcBlock }} {{ $autolink := default true $block.Params.content.autolink }} {{ $data := $block.Params.content }} {{ $form_provider := lower $block.Params.content.form.provider | default "" }} {{ $form_provider_legacy := $block.Params.email_form | default 0 }} {{ $use_netlify_form := eq $form_provider "netlify" | or (eq $form_provider_legacy 1) }} {{ $use_formspree_form := eq $form_provider "formspree" | or (eq $form_provider_legacy 2) }} {{ $use_form := or $use_netlify_form $use_formspree_form }} {{ $use_netlify_captcha := $block.Params.content.form.netlify.captcha | default true }} {{ $use_formspree_captcha := $block.Params.content.form.formspree.captcha | default false }} {{ $columns := $block.Params.design.columns | default "2" }} {{ if and $use_formspree_form $use_formspree_captcha }} {{ end }}
{{ with $block.Content }}{{ . }}{{ end }} {{ if $use_form }} {{ $post_action := "" }} {{ if $use_netlify_form }} {{ $post_action = "netlify" }} {{ else if $use_formspree_form }} {{ if not $block.Params.content.form.formspree.id }} {{ errorf "You have chosen to use Formspree as the provider for the contact form. Please set your Formspree Form ID in the Contact widget or disable the form.\nDocumentation: https://docs.hugoblox.com/widget/contact/" }} {{ end }} {{ if and $use_formspree_captcha (not $block.Params.content.form.formspree.captcha_key) }} {{ errorf "You have chosen to use reCAPTCHA for Formspree. Please set your Formspree CAPTCHA KEY in the Contact widget or disable reCAPTCHA.\nDocumentation: https://help.formspree.io/hc/en-us/articles/360022811154" }} {{ end }} {{ $post_action = printf "action=\"https://formspree.io/f/%s\"" $block.Params.content.form.formspree.id }} {{ end }}
{{ if $block.Params.content.form.netlify.attachments }}
{{ end }}
{{ if and $use_netlify_form $use_netlify_captcha }}
{{ else if and $use_formspree_form $use_formspree_captcha }}

{{ end }}
{{ end }} {{ if and site.Params.features.map.provider $data.coordinates.latitude }}
{{ end }}