diff options
author | mms <michal@sapka.me> | 2024-06-17 20:16:21 +0200 |
---|---|---|
committer | mms <michal@sapka.me> | 2024-06-17 20:16:21 +0200 |
commit | 46ec6e03d79584366a1e269f15ebe4da1f50f7dc (patch) | |
tree | c0d75474af281aab8da6fa941f3f9835a0853b6b /layouts/shortcodes/image.html | |
parent | 874c77e2f875d348afc70b5dd78750f4558f8849 (diff) |
feat: coolmacs
Diffstat (limited to 'layouts/shortcodes/image.html')
-rw-r--r-- | layouts/shortcodes/image.html | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/layouts/shortcodes/image.html b/layouts/shortcodes/image.html index a03ded6..1bc0619 100644 --- a/layouts/shortcodes/image.html +++ b/layouts/shortcodes/image.html @@ -15,6 +15,12 @@ <!-- Decide on the desired 1x and 2x width --> {{- $raw_width := $img.Width}} {{- $final1x_width := (cond (gt $max_width $raw_width) $raw_width $max_width) }} + +<!-- forced width --> +{{ if .Params.forced_width }} + {{ $final1x_width = cast.ToInt .Params.forced_width }} +{{ end }} + {{- $final2x_width := math.Mul $final1x_width 2}} <!-- Generate 1x and 2x images --> |