new: [tags] update tags partial widget to have working tags links

pull/56/head
Alexandre Dulaunoy 2022-02-01 09:34:09 +01:00
parent 5e2045e0d6
commit 2f52cc6b30
No known key found for this signature in database
GPG Key ID: 09E2CD4944E6CBCD
1 changed files with 24 additions and 0 deletions

View File

@ -0,0 +1,24 @@
{{ if .Site.Params.widgets.tags }}
{{ if isset .Site.Taxonomies "tags" }}
{{ if not (eq (len .Site.Taxonomies.tags) 0) }}
<div class="panel sidebar-menu">
<div class="panel-heading">
<h3 class="panel-title">{{ i18n "tagsTitle" }}</h3>
</div>
<div class="panel-body">
<ul class="tag-cloud">
{{ $current := . }}
{{ range $name, $items := .Site.Taxonomies.tags }}
<li {{ if eq $current.RelPermalink (printf "%s/%s/" ("tags" | relLangURL) ($name)) }}class="active"{{ end }}>
<a href="{{ "tags/" | relLangURL }}{{ $name | urlize }}"><i class="fas fa-tags"></i> {{ $name }}</a>
</li>
{{ end }}
</ul>
</div>
</div>
{{ end }}
{{ end }}
{{ end }}