From 848d41b5af8854098fa96fa3ca03d28abee303a1 Mon Sep 17 00:00:00 2001 From: Chaoming Li Date: Sun, 17 Nov 2024 22:47:38 +1100 Subject: [PATCH] feat: add hero shortcode with customizable parameters --- layouts/shortcodes/hero.html | 51 ++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 layouts/shortcodes/hero.html diff --git a/layouts/shortcodes/hero.html b/layouts/shortcodes/hero.html new file mode 100644 index 0000000..b65ad3c --- /dev/null +++ b/layouts/shortcodes/hero.html @@ -0,0 +1,51 @@ +{{ $headline := .Get "headline" }} +{{ $sub_headline := .Get "sub_headline" }} +{{ $primary_button_text := .Get "primary_button_text" }} +{{ $primary_button_url := .Get "primary_button_url" }} +{{ $secondary_button_text := .Get "secondary_button_text" }} +{{ $secondary_button_url := .Get "secondary_button_url" }} +{{ $hero_image := .Get "hero_image" }} +{{ $background_image := .Get "background_image" }} +{{ $background_color_gradient := .Get "background_color_gradient" | default "from-gray-50 to-white" }} + +
+ {{ if $background_image }} +
+ Background +
+ {{ end }} +
+
+
+

+ {{ $headline | safeHTML }} +

+

+ {{ $sub_headline | safeHTML }} +

+
+ {{ if and $primary_button_text $primary_button_url }} + + {{ $primary_button_text }} + + {{ end }} + {{ if and $secondary_button_text $secondary_button_url }} + + {{ $secondary_button_text }} + + {{ end }} +
+
+
+ {{ if $hero_image }} +
+ Hero Image +
+ {{ end }} + +
+
+
+
+
+