diff --git a/layouts/partials/bootstrap/icon-grid.html b/layouts/partials/bootstrap/icon-grid.html index 650c552..9c322c9 100644 --- a/layouts/partials/bootstrap/icon-grid.html +++ b/layouts/partials/bootstrap/icon-grid.html @@ -1,8 +1,13 @@ {{- $key := "" }} {{- $linkText := i18n "learn_more" }} +{{- $linkIcon := partial "icons/icon" (dict + "vendor" "bootstrap" + "name" "arrow-right" + "className" "ms-1") +}} {{- if .IsNamedParams }} {{- $key = .Get "data" }} - {{- with .Get "linkText" }}{{ $linkText = . }}{{ end }} + {{- if isset .Params "linkText" }}{{ $linkText = .Get "linkText" }}{{ end }} {{- else }} {{- $key = .Get 0 }} {{- end }} @@ -11,46 +16,60 @@
{{- range sort . "weight" }}
-
-
- {{- with .icon }} - {{ partial "icons/icon" (merge (dict - "width" "1.25em" - "height" "1.25em" - "vendor" "bootstrap" - "className" "me-3") .) - }} + {{- $icon := "" }} + {{- with .icon }} + {{- $icon = partial "icons/icon" (merge (dict + "width" "1.25em" + "height" "1.25em" + "vendor" "bootstrap" + "className" "me-3") .) + }} + {{- end }} + {{- $link := "" }} + {{- $url := "" }} + {{- if .url }} + {{- $link = .url }} + {{- $url = urls.Parse .url }} + {{- if not $url.Scheme }} + {{- with site.GetPage .url }} + {{- $link = .RelPermalink }} + {{- else }} + {{- $link = relURL .url }} {{- end }} - {{- .title -}} -
-

- {{ .description | markdownify }} -

- {{- if .url }} - {{- $link := .url }} - {{- $url := urls.Parse .url }} - {{- if not $url.Scheme }} - {{- with site.GetPage .url }} - {{- $link = .RelPermalink }} - {{- else }} - {{- $link = relURL .url }} - {{- end }} - {{- end }} -

- - {{- $linkText -}} - {{ partial "icons/icon" (dict - "vendor" "bootstrap" - "name" "arrow-right" - "className" "ms-1") - }} - -

{{- end }} -
+ {{- end }} + {{- if and $link (eq $linkText "") }} + +
+ {{- $icon -}}{{- .title -}} +
+

+ {{ .description | markdownify }} +

+
+ {{ else }} +
+
+ {{- $icon -}}{{- .title -}} +
+

+ {{ .description | markdownify }} +

+ {{- with $link }} +

+ + {{- $linkText -}}{{- $linkIcon -}} + +

+ {{- end }} +
+ {{- end }}
{{- end }}