Skip to content

Commit

Permalink
2023-10-26 18:07:51
Browse files Browse the repository at this point in the history
  • Loading branch information
uidHUB committed Oct 26, 2023
1 parent 0779fa8 commit 8104fb8
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions layouts/taxonomy/tag.terms.html
Original file line number Diff line number Diff line change
@@ -1,17 +1,29 @@
{{ define "main" }}

{{ $tags := (site.Taxonomies.tags.Alphabetical) }}
{{ $tags := (site.Taxonomies.tags) }}
{{ $fontUnit := "rem" }}
{{ $lgFontSize := 2.6 }}
{{ $smFontSize := 1.0 }}
{{ $fontSpread := (sub ($lgFontSize) ($smFontSize)) }}
{{ $max := (add (len (index $tags.ByCount 0).Pages) 1) }}
{{ $min := (len (index $tags.ByCount.Reverse 0).Pages) }}
{{ $spread := (sub ($max) ($min)) }}
{{ $fontStep := (div ($fontSpread) ($spread)) }}

{{ (partial "breadcrumb" .) }}

<div class="article">
<div class="node-body">
<ul class="list-inline">
{{ range ($tags) }}
<li class="list-inline-item">
<a href="{{ (.Page.RelPermalink) }}">{{ (.Page.Title) }}</a>
<sup class="text-body-secondary">{{ (.Count) }}</sup>
</li>
{{ $weigth := (div (sub (math.Log (.Count)) (math.Log ($min))) (sub (math.Log ($max)) (math.Log ($min)))) }}
{{ $currentFontSize := (add ($smFontSize) (mul (sub ($lgFontSize) ($smFontSize)) ($weigth))) }}
<li class="list-inline-item">
<a href="{{ (.Page.RelPermalink) }}" style="font-size: {{ ($currentFontSize) }}{{ ($fontUnit) }};">
{{ (.Page.Title) }}
<sup>{{ (.Count) }}</sup>
</a>
</li>
{{ end }}
</ul>
</div>
Expand Down

0 comments on commit 8104fb8

Please sign in to comment.