Very strange [] quotes within HTML code

Hello, friends! I’m a newbie and trying to implement a simple keyword meta tag for my Hugo template.

For my markdown content files (within content folder) I just setup keywords value on Front Matter:
image

And on my head.html file (within layouts/partials folder) I have very simple code:

// I'm checking, if there Keywords value on my Front Matter
{{ if .Page.Keywords }}
// if so - I just render keywords
  <meta name="keywords" content="{{- .Page.Keywords -}}" />
{{- end -}}

But in the HTML I’m getting quotes, and I don’t understand why they showing up, or how to remove them. I mean, content=“[here my keywords, but I don’t want quotes there]”

keywords should be an array in your front matter, not a string.

keywords:
  - foo
  - bar

Then render the meta element using the delimit function.

<meta name="keywords" content="{{ delimit .Keywords `,` }}">
1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.