mirror of
https://github.com/alanorth/hugo-theme-bootstrap4-blog.git
synced 2024-12-19 09:02:18 +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:
parent
6945b0de20
commit
2dd72d7ec1
@ -41,7 +41,6 @@
|
|||||||
}
|
}
|
||||||
{{- if or (.Params.categories) (.Params.tags) -}}
|
{{- 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) ", " }}"
|
"keywords": "{{ delimit (union .Params.categories .Params.tags) ", " }}"
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user