HUGO

How do I add a frontmatter parameter to inline style?

I’m trying to apply different widths to a div based on what the level parameter is set to in the front matter, which is working but it’s complaining about the syntax (red underlines). Is there another way to do this, or am I doing this right?

style=“width: {{ .Params.level }}%;”

html code, notice red underlines
image

front matter
image

Simply ignore the editor’s warning underlines. The HTML output should be valid and that is the only thing that matters.

2 Likes

This topic was automatically closed after 4 days. New replies are no longer allowed.