|
|
|
@ -40,12 +40,38 @@
|
|
|
|
|
{{ end }}
|
|
|
|
|
<li>Date Added : {{ .Date.Format "2 January 2006" }}</li>
|
|
|
|
|
</ul>
|
|
|
|
|
{{ if .Params.tags }}
|
|
|
|
|
{{ $tags := .Params.tags }}
|
|
|
|
|
<h4>Tags</h4>
|
|
|
|
|
<ul id="tags">
|
|
|
|
|
{{ range .Params.tags }}
|
|
|
|
|
<li>{{ . }}</li>
|
|
|
|
|
<li>
|
|
|
|
|
{{ if not (eq (len $.Site.Taxonomies.tags) 0) }}
|
|
|
|
|
{{ $fontUnit := "rem" }}
|
|
|
|
|
{{ $largestFontSize := 3.5 }}
|
|
|
|
|
{{ $smallestFontSize := 0.5 }}
|
|
|
|
|
{{ $fontSpread := sub $largestFontSize $smallestFontSize }}
|
|
|
|
|
{{ $max := add (len (index $.Site.Taxonomies.tags.ByCount 0).Pages) 1 }}
|
|
|
|
|
{{ $min := len (index $.Site.Taxonomies.tags.ByCount.Reverse 0).Pages }}
|
|
|
|
|
{{ $spread := sub $max $min }}
|
|
|
|
|
{{ $fontStep := div $fontSpread $spread }}
|
|
|
|
|
{{ range $name, $taxonomy := $.Site.Taxonomies.tags }}
|
|
|
|
|
{{ $currentTagCount := len $taxonomy.Pages }}
|
|
|
|
|
{{ $currentFontSize := (add $smallestFontSize (mul (sub $currentTagCount $min) $fontStep) ) }}
|
|
|
|
|
{{ $count := len $taxonomy.Pages }}
|
|
|
|
|
{{ $weigth := div (sub (math.Log $count) (math.Log $min)) (sub (math.Log $max) (math.Log $min)) }}
|
|
|
|
|
{{ $currentFontSize := (add $smallestFontSize (mul (sub $largestFontSize $smallestFontSize) $weigth) ) }}
|
|
|
|
|
{{ range $tags }}
|
|
|
|
|
{{ if eq $name . }}
|
|
|
|
|
|
|
|
|
|
<span style="font-size: {{ $currentFontSize }}{{ $fontUnit }}">{{ $name }}</span>
|
|
|
|
|
|
|
|
|
|
{{ end }}
|
|
|
|
|
{{ end }}
|
|
|
|
|
{{ end }}
|
|
|
|
|
</li>
|
|
|
|
|
</ul>
|
|
|
|
|
{{ end }}
|
|
|
|
|
{{ end }}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="row">
|
|
|
|
|