diff --git a/data/structures/card.yml b/data/structures/card.yml index 10f711a3..f9ca5dac 100644 --- a/data/structures/card.yml +++ b/data/structures/card.yml @@ -211,6 +211,14 @@ arguments: optional: true comment: Render hook for the image partial. group: partial + sizes: + type: string + default: 100vw + optional: true + comment: >- + One or more strings separated by commas, indicating the source sizes of an + image set. + group: partial body: optional: true comment: >- diff --git a/data/structures/image.yml b/data/structures/image.yml index ffa1670f..56aedc6f 100644 --- a/data/structures/image.yml +++ b/data/structures/image.yml @@ -98,6 +98,14 @@ arguments: - low - auto group: partial + sizes: + type: string + default: 100vw + optional: true + comment: >- + One or more strings separated by commas, indicating the source sizes of an + image set. + group: partial title: type: string optional: true diff --git a/exampleSite/hugo_stats.json b/exampleSite/hugo_stats.json index 1ecfdcbd..5b3e0eff 100644 --- a/exampleSite/hugo_stats.json +++ b/exampleSite/hugo_stats.json @@ -181,10 +181,6 @@ "fa-2xs", "fa-4x", "fa-activity", - "fa-angle-left", - "fa-angle-right", - "fa-angles-left", - "fa-angles-right", "fa-arrow-left", "fa-arrow-right", "fa-bootstrap", @@ -331,10 +327,6 @@ "p-2", "p-3", "p-4", - "page-item", - "page-link", - "pagination", - "pagination-terse", "pb-2", "pb-3", "pb-4", @@ -351,7 +343,6 @@ "ps-1", "ps-3", "pt-1", - "pt-3", "pt-5", "pt-md-3", "ptw-3", diff --git a/layouts/partials/assets/card-group.html b/layouts/partials/assets/card-group.html index 982e7a4f..4c57029e 100644 --- a/layouts/partials/assets/card-group.html +++ b/layouts/partials/assets/card-group.html @@ -78,12 +78,38 @@ {{- $responsive := .responsive | default true -}} {{- $cols := string .cols | default "3" -}} +{{- $sizes := "100vw" }} {{- $colGrid := "" -}} -{{- if eq $cols "1" }}{{ $colGrid = "row-cols-1" -}} -{{- else if eq $cols "2" }}{{ if $responsive }}{{ $colGrid = printf "row-cols-1 row-cols-%s-1 row-cols-%s-2" $breakpoint.prev $breakpoint.current }}{{ else }}{{ $colGrid = "row-cols-2" }}{{ end -}} -{{- else if eq $cols "3" }}{{ if $responsive }}{{ $colGrid = printf "row-cols-1 row-cols-%s-2 row-cols-%s-3" $breakpoint.prev $breakpoint.current }}{{ else }}{{ $colGrid = "row-cols-3" }}{{ end -}} -{{- else if eq $cols "4" }}{{ if $responsive }}{{ $colGrid = printf "row-cols-1 row-cols-%s-2 row-cols-%s-4" $breakpoint.prev $breakpoint.current }}{{ else }}{{ $colGrid = "row-cols-4" }}{{ end -}} -{{- else if eq $cols "5" }}{{ if $responsive }}{{ $colGrid = printf "row-cols-1 row-cols-%s-3 row-cols-%s-5" $breakpoint.prev $breakpoint.current }}{{ else }}{{ $colGrid = "row-cols-5" }}{{ end -}} +{{- if eq $cols "1" }} + {{ $colGrid = "row-cols-1" -}} +{{- else if eq $cols "2" }} + {{ if $responsive }} + {{ $colGrid = printf "row-cols-1 row-cols-%s-1 row-cols-%s-2" $breakpoint.prev $breakpoint.current }} + {{ else }} + {{ $colGrid = "row-cols-2" }} + {{ end -}} + {{ $sizes = printf "(min-width: %s) 50vw, 100vw" $breakpoint.currentSize }} +{{- else if eq $cols "3" }} + {{ if $responsive }} + {{ $colGrid = printf "row-cols-1 row-cols-%s-2 row-cols-%s-3" $breakpoint.prev $breakpoint.current }} + {{ else }} + {{ $colGrid = "row-cols-3" }} + {{ end -}} + {{ $sizes = printf "(min-width: %s) 33.3vw, (min-width: %s) 50vw, 100vw" $breakpoint.currentSize $breakpoint.prevSize }} +{{- else if eq $cols "4" }} + {{ if $responsive }} + {{ $colGrid = printf "row-cols-1 row-cols-%s-2 row-cols-%s-4" $breakpoint.prev $breakpoint.current }} + {{ else }} + {{ $colGrid = "row-cols-4" }} + {{ end -}} + {{ $sizes = printf "(min-width: %s) 25vw, (min-width: %s) 50vw, 100vw" $breakpoint.currentSize $breakpoint.prevSize }} +{{- else if eq $cols "5" }} + {{ if $responsive }} + {{ $colGrid = printf "row-cols-1 row-cols-%s-3 row-cols-%s-5" $breakpoint.prev $breakpoint.current }} + {{ else }} + {{ $colGrid = "row-cols-5" }} + {{ end -}} + {{ $sizes = printf "(min-width: %s) 20vw, (min-width: %s) 33.3vw, 100vw" $breakpoint.currentSize $breakpoint.prevSize }} {{ end -}} {{- if not $paginate -}} @@ -102,6 +128,7 @@ "footer" $footer "header" $header "loading" $loading + "sizes" $sizes "orientation" $orientation "padding" $padding "ratio" $ratio diff --git a/layouts/partials/assets/card.html b/layouts/partials/assets/card.html index 7bce69b6..695eaa8c 100644 --- a/layouts/partials/assets/card.html +++ b/layouts/partials/assets/card.html @@ -22,6 +22,7 @@ {{- $iconStyle := "" -}} {{- $align := .align | default "start" -}} {{- $style := .style | default "" -}} +{{- $sizes := .sizes | default "100vw" -}} {{- $loading := .loading -}} {{- $orientation := .orientation | default "stacked" -}} {{- $padding := (string .padding) | default "auto" -}} @@ -131,7 +132,7 @@