Update post_tags partial
* Simplify tags existense check * Update tags partial in line with the Hugo Docs
This commit is contained in:
parent
f184b72d8d
commit
077ae0345e
1 changed files with 9 additions and 6 deletions
|
@ -1,8 +1,11 @@
|
||||||
{{ if isset $.Params "tags" }}
|
{{- $taxo := "tags" -}}
|
||||||
{{ $tagsLen := len $.Params.tags }}
|
{{- with .Param $taxo }}
|
||||||
{{ if gt $tagsLen 0 }}
|
|
||||||
<div class="post__tags">
|
<div class="post__tags">
|
||||||
{{ range $k, $v := $.Params.tags }}<a class="post__tag btn" href="{{ "/tags/" | relLangURL }}{{ . | urlize | lower }}">{{ . }}</a>{{ end }}
|
{{- range . }}
|
||||||
|
{{- $name := . -}}
|
||||||
|
{{- with $.Site.GetPage (printf "/%s/%s" $taxo ($name | urlize)) }}
|
||||||
|
<a class="post__tag btn" href="{{ .RelPermalink }}">{{ .Title }}</a>
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
</div>
|
</div>
|
||||||
{{ end }}
|
{{- end }}
|
||||||
{{ end }}
|
|
Loading…
Reference in a new issue