You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

57 lines
1.9 KiB
HTML

{{ partial "header.html" . }}
{{ partial "navbar.html" . }}
<main class="blog-entry">
<div class="container">
<div class="row">
<div class="col-md-12 text-center">
<h1 class="h2 section-header pb-0">{{ .Title }}</h1>
{{ if .Params.author }}
<h2>Author : {{ .Params.author }}</h2>
{{ end }}
<h3>Published on {{ .Date.Format "Monday 2 January 2006" }}</h3>
</div>
</div>
<div class="row"><hr></div>
<div class="row">
<div class="col-md-2">&nbsp;</div>
<div class="col-md-8 text-left">
{{ .Content }}
</div>
<div class="col-md-2">&nbsp;</div>
</div>
<div class="row"><hr></div>
</div>
{{ if .Params.tags }}
{{ $tags := .Params.tags }}
<div class="row">
<div class="col-lg-3"></div>
<div class="col-lg-6 text-center tags">
{{ if not (eq (len $.Site.Taxonomies.tags) 0) }}
{{ $fontUnit := "rem" }}
{{ $largestFontSize := 2.25 }}
{{ $smallestFontSize := 0.25 }}
{{ $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 . }}
&nbsp;<span style="font-size: {{ $currentFontSize }}{{ $fontUnit }}">{{ $name }}</span>&nbsp;
{{ end }}
{{ end }}
{{ end }}
{{ end }}
</div>
<div class="col-lg-3"></div>
</div>
{{ end }}
</main>
{{ partial "footer.html" . }}