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:
Slashdoom authored and George committed 2019-12-28 20:44:44 +00:00
1 parent 30b6d5c7e5
commit 6c86640af4
1 file changed
+2 -1
+2 -1
View File
@@ -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 }}