-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add the img-grid shortcode (#105)
- Loading branch information
Showing
3 changed files
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{{- $key := "" }} | ||
{{- if .IsNamedParams }} | ||
{{- $key = .Get "data" }} | ||
{{- else }} | ||
{{- $key = .Get 0 }} | ||
{{- end }} | ||
{{- $data := partialCached "bootstrap/functions/data" (dict "key" $key "page" .Page) .Page $key }} | ||
{{- with $data }} | ||
<div class="d-flex bs-img-grid flex-wrap gap-1 justify-content-center"> | ||
{{- range . }} | ||
{{- $img := partial "images/image" (dict | ||
"Filename" .src | ||
"ClassName" "bs-img-grid-item-img" | ||
"Alt" .title | ||
"Caption" .title) | ||
}} | ||
{{- if .url }} | ||
<a class="bs-img-grid-item text-center" href="{{ .url }}" target="_blank"> | ||
{{ $img }} | ||
</a> | ||
{{- else }} | ||
<div class="bs-img-grid-item text-center"> | ||
{{ $img }} | ||
</div> | ||
{{- end }} | ||
{{- end }} | ||
</div> | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{{ partial "bootstrap/img-grid" . }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{{ partial "bootstrap/img-grid" . }} |