From 9cd9421a58fdf201ccdaedfe9b3a14c02e06561b Mon Sep 17 00:00:00 2001 From: Chaoming Li Date: Mon, 18 Nov 2024 14:31:40 +1100 Subject: [PATCH] feat: convert feature sections into reusable shortcodes with consistent styling --- layouts/index.html | 59 ------------------------ layouts/shortcodes/feature.html | 42 +++++++++++++++++ layouts/shortcodes/features-section.html | 17 +++++++ 3 files changed, 59 insertions(+), 59 deletions(-) create mode 100644 layouts/shortcodes/feature.html create mode 100644 layouts/shortcodes/features-section.html diff --git a/layouts/index.html b/layouts/index.html index caef66f..339147f 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -4,65 +4,6 @@ {{ .Content }} {{ end }} - -
-
-
-

Powerful Features for Modern Teams

-

Discover how our platform helps you understand and optimize every aspect of your user experience.

-
- - -
- -
-
-
User Analytics
-

Deep Insights into User Behavior

-

Track and analyze user interactions in real-time. Understand how users navigate your product and identify opportunities for improvement.

-
    - {{ range (slice "Real-time user tracking" "Behavioral analytics" "Custom event tracking" "User flow visualization") }} -
  • - - - - {{ . }} -
  • - {{ end }} -
- Learn More -
-
- Analytics Feature -
-
- - -
-
- Session Replay Feature -
-
-
Session Replay
-

Watch Real User Sessions

-

Understand exactly how users interact with your product through high-fidelity session recordings and heatmaps.

-
    - {{ range (slice "Full session recordings" "Click and scroll heatmaps" "Error tracking" "User journey analysis") }} -
  • - - - - {{ . }} -
  • - {{ end }} -
- Learn More -
-
-
-
-
-
diff --git a/layouts/shortcodes/feature.html b/layouts/shortcodes/feature.html new file mode 100644 index 0000000..55e7d27 --- /dev/null +++ b/layouts/shortcodes/feature.html @@ -0,0 +1,42 @@ +{{/* Feature Shortcode */}} +{{ $title := .Get "title" }} +{{ $description := .Get "description" }} +{{ $badge := .Get "badge" }} +{{ $badgeColor := .Get "badgeColor" | default "primary" }} +{{ $image := .Get "image" }} +{{ $buttonText := .Get "buttonText" | default "Learn More" }} +{{ $buttonLink := .Get "buttonLink" | default "#" }} +{{ $imagePosition := .Get "imagePosition" | default "right" }} + +{{ $features := split (.Get "features") "," }} + +
+ {{ if eq $imagePosition "left" }} +
+ {{ $title }} +
+ {{ end }} + +
+
{{ $badge }}
+

{{ $title }}

+

{{ $description }}

+
    + {{ range $features }} +
  • + + + + {{ . | strings.TrimSpace }} +
  • + {{ end }} +
+ {{ $buttonText }} +
+ + {{ if ne $imagePosition "left" }} +
+ {{ $title }} +
+ {{ end }} +
diff --git a/layouts/shortcodes/features-section.html b/layouts/shortcodes/features-section.html new file mode 100644 index 0000000..b23c982 --- /dev/null +++ b/layouts/shortcodes/features-section.html @@ -0,0 +1,17 @@ +{{/* Features Section Wrapper Shortcode */}} +{{ $title := .Get "title" | default "Powerful Features for Modern Teams" }} +{{ $description := .Get "description" | default "Discover how our platform helps you understand and optimize every aspect of your user experience." }} + +
+
+
+

{{ $title }}

+

{{ $description }}

+
+ + +
+ {{ .Inner }} +
+
+