Skip to content

Commit

Permalink
feat(icon-grid): add the alignment parameter, available options: star…
Browse files Browse the repository at this point in the history
…t, center or end
  • Loading branch information
razonyang committed Sep 19, 2023
1 parent cb61239 commit d941ba8
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions layouts/partials/bootstrap/icon-grid.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@
"className" "ms-1")
}}
{{- $border := true }}
{{- $alignment := "start" }}
{{- if .IsNamedParams }}
{{- $key = .Get "data" }}
{{- if isset .Params "linkText" }}{{ $linkText = .Get "linkText" }}{{ end }}
{{- if isset .Params "border" }}{{ $border = .Get "border" }}{{ end }}
{{- with .Get "alignment" }}{{ $alignment = . }}{{ end }}
{{- else }}
{{- $key = .Get 0 }}
{{- end }}
Expand Down Expand Up @@ -46,19 +48,19 @@
{{- end }}
{{- if and $link (eq $linkText "") }}
<a
class="d-flex flex-column rounded h-100 w-100 p-4 text-decoration-none{{ cond $border ` border shadow` `` }}"
class="d-flex flex-column rounded h-100 w-100 p-4 text-decoration-none{{ cond $border ` border shadow` `` }} text-{{ $alignment }}"
href="{{ $link }}"
{{ if $url.Scheme }}target="_blank" rel="external"{{ end }}>
<div class="fw-bold mb-3 fs-4 d-flex align-items-center">
<div class="fw-bold mb-3 fs-4 d-flex align-items-center justify-content-{{ $alignment }}">
{{- $icon -}}{{- .title -}}
</div>
<p class="mb-0 text-body-secondary">
{{ .description | markdownify }}
</p>
</a>
{{ else }}
<div class="d-flex flex-column rounded h-100 w-100 p-4{{ cond $border ` border shadow` `` }}">
<div class="fw-bold mb-3 fs-4 d-flex align-items-center">
<div class="d-flex flex-column rounded h-100 w-100 p-4{{ cond $border ` border shadow` `` }} text-{{ $alignment }}">
<div class="fw-bold mb-3 fs-4 d-flex align-items-center justify-content-{{ $alignment }}">
{{- $icon -}}{{- .title -}}
</div>
<p class="mb-0 text-body-secondary">
Expand Down

0 comments on commit d941ba8

Please sign in to comment.