mirror of
https://github.com/Vimux/Binario.git
synced 2024-11-11 01:38:28 +00:00
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" }}
|
||||
{{ $tagsLen := len $.Params.tags }}
|
||||
{{ if gt $tagsLen 0 }}
|
||||
{{- $taxo := "tags" -}}
|
||||
{{- with .Param $taxo }}
|
||||
<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>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{- end }}
|
Loading…
Reference in a new issue