Problem with cover in post

Hi everyone!

I’m new here and having trouble adding a cover image to my first post.

The code is:
+++
title = ‘First’
date = 2024-03-19T18:14:09-03:00
draft = false
cover = {
image = “img\cover.jpg”
}
+++

The problem returned is: Error: error building site: process: readAndProcessContent: “C:\Hugo\beeasy2\content\posts\first.md:5:10”: unmarshal failed: toml: invalid character at start of key:

If I remove the following code, it works, so the problem is with the cover.
cover = {
image = “img\cover.jpg”
}

Env:

hugo v0.124.0-629f84e8edfb0b1b743c3942cd039da1d99812b0+extended windows/amd64 BuildDate=2024-03-16T15:44:32Z VendorInfo=gohugoio
GOOS=“windows”
GOARCH=“amd64”
GOVERSION=“go1.22.1”
github.com/sass/libsass=“3.6.5”
github.com/webmproject/libwebp=“v1.3.2”

Any help figuring out the issue would be much appreciated!

When posting code, configuration, or data on this forum, please wrap the text within backticks or use the </> button in the menu.

```
my code
```

Your TOML is malformed. Not sure what you’re trying to accomplish.

I’m trying do it: https://youtu.be/hjD9jTi_DQ4?t=1359 put a image in my first post blog.

+++
title = ‘First’
date = 2024-03-19T18:14:09-03:00
draft = false
cover = {
image = “img\cover.jpg”
}
+++```

Oh no.

The tutorial author is using YAML, not TOML, but the above isn’t correct either way.

Ok that my code have a error I understood. What I don’t know is how to solve.

cover = {
image = “img\cover.jpg”
}```

Do you know how to solve?

Yes, by doing what the tutorial author does:

image

It works now! Thank you for the help. I initially hesitated to change the +++ to --- and : to = because running hugo new posts/first.md originally created my file with the +++ and : symbols.

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