These are the number of ways to manipulate array / slices in Hugo.
To convert strings to slice, you use split command:
{{- split "String" "delimiter" -}}Example:
{{- $keywords := split "Hello World" " " -}}# You get:[ "Hello", "World"]To convert slice to strings, you use delimit command:
{{- delimit $slice $join_pattern $optional_last_element_join_pattern -}}Example:
{{- delimit ["Hello", "World", "Smith"] ", " ", and" -}}# You get:"Hello, World, and Smith"{{- delimit ["Hello", "World", "Smith"] ", " -}}# You get:"Hello, World, Smith"