1
0
mirror of https://github.com/alanorth/hugo-theme-bootstrap4-blog.git synced 2024-12-19 00:52:19 +01:00

layouts/_default/single.html: Improve Schema.org keywords

Use delimit function over a union of Categories and Tags. This is
much easier to read, results in correct delimiting with no trailing
comma, and works even if one of the slices is nil.
This commit is contained in:
Alan Orth 2017-07-07 16:29:59 +03:00
parent 6945b0de20
commit 2dd72d7ec1
Signed by: alanorth
GPG Key ID: 0FB860CC9C45B1B9

View File

@ -41,7 +41,6 @@
}
{{- if or (.Params.categories) (.Params.tags) -}}
,
{{- /* delimit keywords by comma, even if one of .Params.categories or Params.tags is nil */ -}}
"keywords": "{{ delimit (union .Params.categories .Params.tags) ", " }}"
{{- end }}