Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions exampleSite/content/test-product/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@ This is a compilation of all our shortcodes to show how they look, function, res

{{<card-layout >}}
{{<card-section title="NGINX" showAsCards="true" >}}
{{<card title="NGINX Plus" titleUrl="/nginx/" brandIcon="NGINX-Plus-product-icon-RGB.svg" >}}
Installing NGINX
{{</card >}}
{{<card title="NGINX Plus" titleUrl="/nginx/" brandIcon="NGINX-Plus-product-icon-RGB.svg" />}}
{{</card-section >}}
{{</card-layout >}}
32 changes: 17 additions & 15 deletions layouts/shortcodes/card.html
Original file line number Diff line number Diff line change
Expand Up @@ -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") -}}
Expand All @@ -50,7 +50,9 @@ <h2 class="card-title">{{- $title -}}</h2>
{{- else -}}
{{ errorf "Mainframe: Missing param 'title'" }}
{{- end -}}
<div class="card-content">{{ .Inner }}</div>
{{- with .Inner -}}
<div class="card-content">{{ . }}</div>
{{- end -}}
</div>
</a>
{{- else -}}
Expand Down