setup
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
{{ if . }}
|
||||
{{ $fontSmall := 1 }}
|
||||
{{ $fontBig := 1.6 }}
|
||||
{{ $fontSpread := sub $fontBig $fontSmall }}
|
||||
|
||||
{{ $termCount := slice }}
|
||||
{{ range . }}
|
||||
{{ $termCount = append .Count $termCount }}
|
||||
{{ end }}
|
||||
{{ $termCount = sort $termCount }}
|
||||
|
||||
{{ $min := int (index $termCount 0) }}
|
||||
{{ $max := add (int (index $termCount (sub (len $termCount) 1))) 1 }}
|
||||
|
||||
<div>
|
||||
{{ range . }}
|
||||
{{ $weight := div (sub (math.Log .Count) (math.Log $min)) (sub (math.Log $max) (math.Log $min)) }}
|
||||
{{ $fontSize := (add $fontSmall (mul $fontSpread $weight)) }}
|
||||
|
||||
<a class="term-item" href="{{ .Page.RelPermalink }}">
|
||||
<span style="font-size:{{ $fontSize }}rem">{{- .Page.Title -}}</span>
|
||||
<span style="font-size:{{ sub $fontSmall 0.2 }}rem"> ({{- .Count -}}) </span>
|
||||
</a>
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ end }}
|
||||
Reference in New Issue
Block a user