Hey folks,
I’m working on my website and I’m relatively new to Hugo.
I’m implementing seo-schema
in the head of my site, and I’ve hit a problem with the following code:
"keywords" : [ {{ if isset .Params "tags" }}{{ delimit .Params.tags ", " }}, {{ end }}{{ delimit .Site.Params.seo_tags ", " }} ]
The output of the above is
"keywords": [ "tag1, tag2, tag3" ]
whereas it should be
"keywords": [ "tag1", "tag2", "tag3" ]
I’ve tried using backticks in place of the quotes like this:
"keywords" : [ {{ if isset .Params "tags" }}{{ delimit .Params.tags `", "` }}, {{ end }}{{ delimit .Site.Params.seo_tags `", "` }} ]
but that renders
"keywords": [ "tag1\", \"tag2\", \"tag3" ]
which isn’t valid syntax either.
Is there any way to enclose each item of the “delimit” loop with quotation marks?
An example of .Params.tags is as follows:
---
tags:
- tag1
- tag2
- tag3
Thanks in advance.