From 59a591c73b6b6897a6ff253aa8eaf7630daf40e7 Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Sat, 5 Feb 2022 15:02:00 +0100 Subject: [PATCH] fix: prevent failing build if tags is an empty string (#187) --- layouts/partials/head/schema.html | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/layouts/partials/head/schema.html b/layouts/partials/head/schema.html index 22f3b00..e0ea512 100644 --- a/layouts/partials/head/schema.html +++ b/layouts/partials/head/schema.html @@ -78,7 +78,9 @@ {{- end }} "url" : "{{ .Permalink }}", "wordCount" : "{{ .WordCount }}", - "genre" : [ {{ range $i, $tag := .Params.tags }}{{ if $i }}, {{ end }}"{{ $tag }}" {{ end }}] + {{- with $tags := .Params.tags }} + "genre" : [ {{ range $i, $tag := $tags }}{{ if $i }}, {{ end }}"{{ $tag }}" {{ end }}] + {{- end }} } {{ end }}