From 077ae0345e2942b9a2f6944672022b4e423fb1b4 Mon Sep 17 00:00:00 2001 From: vimux Date: Tue, 12 Nov 2019 09:45:51 -0500 Subject: [PATCH] Update post_tags partial * Simplify tags existense check * Update tags partial in line with the Hugo Docs --- layouts/partials/post_tags.html | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/layouts/partials/post_tags.html b/layouts/partials/post_tags.html index 8038a7d..148a613 100644 --- a/layouts/partials/post_tags.html +++ b/layouts/partials/post_tags.html @@ -1,8 +1,11 @@ -{{ if isset $.Params "tags" }} -{{ $tagsLen := len $.Params.tags }} -{{ if gt $tagsLen 0 }} +{{- $taxo := "tags" -}} +{{- with .Param $taxo }}
- {{ range $k, $v := $.Params.tags }}{{ end }} + {{- range . }} + {{- $name := . -}} + {{- with $.Site.GetPage (printf "/%s/%s" $taxo ($name | urlize)) }} + + {{- end }} + {{- end }}
-{{ end }} -{{ end }} \ No newline at end of file +{{- end }} \ No newline at end of file