- {{ $order1 := "order-1 order-md-0" }}
- {{ $order2 := "order-0 order-md-1" }}
- {{ if eq $args.order "first" }}
- {{ $order1 = "order-1" }}
- {{ $order2 = "order-0" }}
- {{ end }}
+
+ {{ $order1 := "order-1 order-md-0" }}
+ {{ $order2 := "order-0 order-md-1" }}
+ {{ if eq $args.order "first" }}
+ {{ $order1 = "order-1" }}
+ {{ $order2 = "order-0" }}
+ {{ end }}
- {{ $imgWidth := sub 12 (or $args.heading.width 12) }}
- {{ if lt $imgWidth 1 }}{{ $imgWidth = 1 }}{{ end }}
+ {{ $imgWidth := sub 12 (or $args.heading.width 12) }}
+ {{ if lt $imgWidth 1 }}{{ $imgWidth = 1 }}{{ end }}
-
- {{ $title | safeHTML }}
-
- {{ if $illustration }}
-
- {{ $illustration | safeHTML }}
- {{ $caption | safeHTML }}
-
- {{ end }}
+
+ {{ $title | safeHTML }}
+ {{ $args.raw | safeHTML }}
+
+ {{ if $illustration }}
+
+ {{ $illustration | safeHTML }}
+ {{ $caption | safeHTML }}
+ {{ end }}
{{ end }}
{{ end }}
From 5a571484436e658b68cda41448d2917b377cf472 Mon Sep 17 00:00:00 2001
From: Mark Dumay <61946753+markdumay@users.noreply.github.com>
Date: Fri, 3 Apr 2026 08:41:04 +0200
Subject: [PATCH 2/2] feat: add illustration support to contact form
---
.../contact-form/contact-form.bookshop.yml | 10 +++++-
.../contact-form/contact-form.hugo.html | 32 +++++++++++++++----
2 files changed, 35 insertions(+), 7 deletions(-)
diff --git a/component-library/components/contact-form/contact-form.bookshop.yml b/component-library/components/contact-form/contact-form.bookshop.yml
index 219e4ef..c932ce6 100644
--- a/component-library/components/contact-form/contact-form.bookshop.yml
+++ b/component-library/components/contact-form/contact-form.bookshop.yml
@@ -20,7 +20,15 @@ blueprint:
backdrop:
color:
subtle:
- image:
+ illustration:
+ image:
+ icon:
+ ratio:
+ class:
+ anchor:
+ mode:
+ width:
+ order: last
hook:
action:
form_id:
diff --git a/component-library/components/contact-form/contact-form.hugo.html b/component-library/components/contact-form/contact-form.hugo.html
index 19bab8d..9030cef 100644
--- a/component-library/components/contact-form/contact-form.hugo.html
+++ b/component-library/components/contact-form/contact-form.hugo.html
@@ -49,14 +49,34 @@
{{/* Main code */}}
{{ $color := "" }}
+ {{ $raw := "" }}
{{ if .contrast }}{{ $color = "white" }}{{ end }}
- {{- $raw := partial "assets/section-title.html" (dict
- "heading" .heading
- "justify" .justify
- "class" (printf "pb-%d" $padding.y))
- -}}
- {{ $raw = printf "%s%s" $raw (partial .hook (dict "action" .action "form-id" .form_id)) }}
+ {{ $form := (partial .hook (dict "action" .action "form-id" .form_id)) }}
+ {{ if .illustration }}
+ {{/* Embed the form in a horizontal hero with an illustration */}}
+ {{ $width := sub 12 (.illustration.width | default 6) }}
+ {{ $raw = partial "assets/hero.html" (dict
+ "page" page
+ "raw" (printf `
%s` $padding.y $form)
+ "heading" (merge .heading (dict "width" $width))
+ "illustration" (merge .illustration (dict "width" 12))
+ "order" .order
+ "link-type" (or .link_type (index . "link-type"))
+ "links" .links
+ "orientation" "horizontal"
+ "width" .width
+ )
+ }}
+ {{ else }}
+ {{- $raw = partial "assets/section-title.html" (dict
+ "heading" .heading
+ "justify" .justify
+ "class" (printf "pb-%d" $padding.y))
+ -}}
+ {{ $raw = printf "%s%s" $raw $form }}
+ {{ end }}
+
{{ if $raw }}
{{ partial "utilities/section.html" (dict
"component-name" "contact-form"