mirror of
https://github.com/tiennm99/HugoBlox-kit.git
synced 2026-10-13 10:15:22 +00:00
fix(widget): tag cloud max size calculation (#1497)
Calculate max value first since the list is mutable to Hugo's `Reverse` function - i.e. Hugo's `Reverse` function currently appears to operate in-place.
This commit is contained in:
1 parent
30b6d5c7e5
commit
6c86640af4
1 file changed
+2
-1
@@ -29,8 +29,9 @@
|
||||
{{ if ne $count 0 }}
|
||||
|
||||
{{ $fontDelta := sub $fontBig $fontSmall }}
|
||||
{{ $min := len (index ($tags).Reverse 0).Pages }}
|
||||
{{/* Warning: Hugo's `Reverse` function appears to operate in-place, hence the order of performing $max/$min matters. */}}
|
||||
{{ $max := add (len (index $tags 0).Pages) 1 }}
|
||||
{{ $min := len (index ($tags).Reverse 0).Pages }}
|
||||
{{ $delta := sub $max $min }}
|
||||
{{ $fontStep := div $fontDelta $delta }}
|
||||
|
||||
|
||||
Reference in new issue
Block a user