From 292d508a90b194e0fecba44ea0a8e16a88fabf22 Mon Sep 17 00:00:00 2001 From: Lam Nguyen Date: Mon, 28 Jul 2025 15:08:14 -0700 Subject: [PATCH 1/2] Card: Handle case of no inner for cards --- layouts/shortcodes/card.html | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/layouts/shortcodes/card.html b/layouts/shortcodes/card.html index ee92009a..aa7b07eb 100644 --- a/layouts/shortcodes/card.html +++ b/layouts/shortcodes/card.html @@ -17,22 +17,22 @@ {{- $isLanding := cond (eq $isLandingParam "true") "true" "false" -}} {{- /* Set up the positioning */ -}} -{{ $dataGrid := "" }} -{{ if eq $isFullSize "true" }} - {{ $dataGrid = "wide"}} -{{ else if (eq $isLanding "true") }} - {{ $dataGrid = "third"}} -{{ else }} - {{ $dataGrid = "half"}} -{{ end }} +{{- $dataGrid := "" -}} +{{- if eq $isFullSize "true" -}} + {{- $dataGrid = "wide" -}} +{{- else if (eq $isLanding "true") -}} + {{- $dataGrid = "third" -}} +{{- else -}} + {{- $dataGrid = "half" -}} +{{- end -}} {{- /* Build the url */ -}} -{{ $url := printf "%s%s" .Page.Permalink $titleUrl }} -{{ if eq (substr $titleUrl 0 1) "/" }} - {{ $url = printf "%s%s" .Site.BaseURL (substr $titleUrl 1) }} -{{ else if (strings.Contains $titleUrl "https") }} - {{ $url = $titleUrl }} -{{ end }} +{{- $url := printf "%s%s" .Page.Permalink $titleUrl -}} +{{- if eq (substr $titleUrl 0 1) "/" -}} + {{- $url = printf "%s%s" .Site.BaseURL (substr $titleUrl 1) -}} +{{- else if (strings.Contains $titleUrl "https") -}} + {{- $url = $titleUrl -}} +{{- end -}} {{- /* Validate that the parent is card-section and under 3 cards */ -}} {{- if (eq .Parent.Name "card-section") -}} @@ -50,7 +50,9 @@

{{- $title -}}

{{- else -}} {{ errorf "Mainframe: Missing param 'title'" }} {{- end -}} -
{{ .Inner }}
+ {{- with .Inner -}} +
{{ . }}
+ {{- end -}} {{- else -}} From a8a3db15a8e8cff3a5d75764b8475ac89e5a0096 Mon Sep 17 00:00:00 2001 From: Lam Nguyen Date: Mon, 28 Jul 2025 15:29:09 -0700 Subject: [PATCH 2/2] Card: Updated test product landing page --- exampleSite/content/test-product/_index.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/exampleSite/content/test-product/_index.md b/exampleSite/content/test-product/_index.md index fa48486f..fffc6afe 100644 --- a/exampleSite/content/test-product/_index.md +++ b/exampleSite/content/test-product/_index.md @@ -54,8 +54,6 @@ This is a compilation of all our shortcodes to show how they look, function, res {{}} {{}} - {{}} - Installing NGINX - {{}} + {{}} {{}} {{}}