From 89c6d73598283d4dfe3626b8bbbb5f30ffaaec04 Mon Sep 17 00:00:00 2001 From: Chaoming Li Date: Wed, 4 Dec 2024 16:47:57 +1100 Subject: [PATCH] added new shortcodes to support feature pages --- layouts/_default/feature.html | 2 +- layouts/partials/icons.html | 22 +++++++++++++++++++++ layouts/shortcodes/benefits-grid.html | 25 ++++++++++++++++++++++++ layouts/shortcodes/case-study-card.html | 15 ++++++++++++++ layouts/shortcodes/features-list.html | 26 +++++++++++++++++++++++++ layouts/shortcodes/hero-image.html | 3 +++ 6 files changed, 92 insertions(+), 1 deletion(-) create mode 100644 layouts/partials/icons.html create mode 100644 layouts/shortcodes/benefits-grid.html create mode 100644 layouts/shortcodes/case-study-card.html create mode 100644 layouts/shortcodes/features-list.html create mode 100644 layouts/shortcodes/hero-image.html diff --git a/layouts/_default/feature.html b/layouts/_default/feature.html index d85b8c6..8609a60 100644 --- a/layouts/_default/feature.html +++ b/layouts/_default/feature.html @@ -12,7 +12,7 @@ }
-
+
{{ with .Params.badge }} diff --git a/layouts/partials/icons.html b/layouts/partials/icons.html new file mode 100644 index 0000000..a5e0bfb --- /dev/null +++ b/layouts/partials/icons.html @@ -0,0 +1,22 @@ +{{- $iconClass := printf "w-%s h-%s" (.size | default "6") (.size | default "6") -}} +{{- $color := .color | default "#000000" -}} + + + {{- if eq .name "chart" -}} + + {{- else if eq .name "attribution" -}} + + {{- else if eq .name "roi" -}} + + {{- else if eq .name "check" -}} + + {{- else if eq .name "analytics" -}} + + {{- else if eq .name "funnel" -}} + + {{- else if eq .name "target" -}} + + {{- else if eq .name "custom" -}} + {{ .path | safeHTML }} + {{- end -}} + diff --git a/layouts/shortcodes/benefits-grid.html b/layouts/shortcodes/benefits-grid.html new file mode 100644 index 0000000..ddb2887 --- /dev/null +++ b/layouts/shortcodes/benefits-grid.html @@ -0,0 +1,25 @@ +{{ $title := .Get "title" }} +{{ $subtitle := .Get "subtitle" }} + +
+

{{ $title }}

+

{{ $subtitle }}

+
+ +
+ {{ range $index := (seq 1 10) }} + {{ $benefit := printf "benefit%d" $index }} + {{ with $.Get $benefit }} + {{ $parts := split . "|" }} + {{ if ge (len $parts) 4 }} +
+
+ {{ partial "icons" (dict "name" (index $parts 0) "color" (index $parts 1) "size" "6") }} +
+

{{ index $parts 2 }}

+

{{ index $parts 3 }}

+
+ {{ end }} + {{ end }} + {{ end }} +
diff --git a/layouts/shortcodes/case-study-card.html b/layouts/shortcodes/case-study-card.html new file mode 100644 index 0000000..c6eeb74 --- /dev/null +++ b/layouts/shortcodes/case-study-card.html @@ -0,0 +1,15 @@ +
+
+
+
+
{{ .Get 1 }}
+
{{ .Get 2 }}
+
{{ .Get 3 }}
+ {{ .Get 4 }} +
+
+ {{ .Get 7 }} +
+
+
+
diff --git a/layouts/shortcodes/features-list.html b/layouts/shortcodes/features-list.html new file mode 100644 index 0000000..2cff91d --- /dev/null +++ b/layouts/shortcodes/features-list.html @@ -0,0 +1,26 @@ +{{ $title := .Get "title" }} +{{ $color := .Get "color" | default "#2563eb" }} + +
+

{{ $title }}

+ +
+ {{ range $index := (seq 1 10) }} + {{ $feature := printf "feature%d" $index }} + {{ with $.Get $feature }} + {{ $parts := split . "|" }} + {{ if ge (len $parts) 2 }} +
+
+ {{ partial "icons" (dict "name" "check" "color" $color "size" "6") }} +
+
+

{{ index $parts 0 }}

+

{{ index $parts 1 }}

+
+
+ {{ end }} + {{ end }} + {{ end }} +
+
diff --git a/layouts/shortcodes/hero-image.html b/layouts/shortcodes/hero-image.html new file mode 100644 index 0000000..9d5695f --- /dev/null +++ b/layouts/shortcodes/hero-image.html @@ -0,0 +1,3 @@ +
+ {{ .Get 1 }} +