Gefixte Links bei Cloud und Taglist
This commit is contained in:
parent
a79492da55
commit
533d7f2e46
2 changed files with 20 additions and 20 deletions
|
@ -1,15 +1,15 @@
|
|||
<div class="tag-cloud d-inline-block m-0 p-0">
|
||||
{{ $parentLink := ($.Params.Site.GetPage (printf "/%s" .ident)).Permalink }}
|
||||
{{ $maxCnt := mul 1.0 (index .tax.ByCount 0).Count }}
|
||||
{{ $minCnt := mul 1.0 (index .tax.ByCount.Reverse 0).Count }}
|
||||
{{ $div := math.Max 1 (sub $maxCnt $minCnt) }}
|
||||
{{ range $key, $sites := .tax }}
|
||||
<!-- add (mul (math.Pow (div $sites.Count $maxCnt) 2.0) 14.0) 8.0 px -->
|
||||
{{- (printf `<a class="tag-cloud-link m-1 p-1" style="font-size: %.3frem;" href="%s" aria-label="%s %d Einträge">%s<sup>%d</sup></a>`
|
||||
(add (mul (math.Pow (div (sub $sites.Count $minCnt) $div) 2.0) 0.6) 0.8)
|
||||
((printf "%s%s" $parentLink $key) | relURL) $key $sites.Count $key $sites.Count
|
||||
) | safeHTML -}}
|
||||
<!--<span class="badge">{{ $sites.Count }}</span>-->
|
||||
{{ end }}
|
||||
{{ $parentLink := (site.GetPage (printf "/%s" .ident)).Permalink }}
|
||||
{{ $maxCnt := mul 1.0 (index .tax.ByCount 0).Count }}
|
||||
{{ $minCnt := mul 1.0 (index .tax.ByCount.Reverse 0).Count }}
|
||||
{{ $div := math.Max 1 (sub $maxCnt $minCnt) }}
|
||||
{{ range $key, $sites := .tax }}
|
||||
<!-- add (mul (math.Pow (div $sites.Count $maxCnt) 2.0) 14.0) 8.0 px -->
|
||||
{{- (printf `<a class="tag-cloud-link m-1 p-1" style="font-size: %.3frem;" href="%s" aria-label="%s %d Einträge">%s<sup>%d</sup></a>`
|
||||
(add (mul (math.Pow (div (sub $sites.Count $minCnt) $div) 2.0) 0.6) 0.8)
|
||||
((printf "%s%s" $parentLink $key) | relURL) $key $sites.Count $key $sites.Count
|
||||
) | safeHTML -}}
|
||||
<!--<span class="badge">{{ $sites.Count }}</span>-->
|
||||
{{ end }}
|
||||
</div>
|
||||
{{/* https://mertbakir.gitlab.io/hugo/tag-cloud-in-hugo/ */}}
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
<div class="categories mb-2 d-inline-block">
|
||||
{{ $parentLink := ($.Params.Site.GetPage (printf "/%s" .ident)).Permalink }}
|
||||
{{ range $key, $sites := .tax }}
|
||||
<div class="m-1 d-inline-flex">
|
||||
<a class="bg-dark text-white py-1 px-2 m-0 rounded-start" href="{{ (printf "%s%s" $parentLink $key) | relURL }}">{{ $key }}</a>
|
||||
<div class="bg-danger text-white py-1 px-2 m-0 rounded-end">{{ $sites.Count }}</div>
|
||||
</div>
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ $parentLink := (site.GetPage (printf "/%s" .ident)).Permalink }}
|
||||
{{ range $key, $sites := .tax }}
|
||||
<div class="m-1 d-inline-flex">
|
||||
<a class="bg-dark text-white py-1 px-2 m-0 rounded-start" href="{{ (printf "%s%s" $parentLink $key) | relURL }}">{{ $key }}</a>
|
||||
<div class="bg-danger text-white py-1 px-2 m-0 rounded-end">{{ $sites.Count }}</div>
|
||||
</div>
|
||||
{{ end }}
|
||||
</div>
|
||||
|
|
Loading…
Reference in a new issue