Error: config.toml:7:7": unmarshal failed: toml: expected character =

(I am a rank beginner. Sorry in advance.)

I’ve spent the evening exploring the docs and trying things out and I seem to have screwed up the config.toml file. This is the file that Hugo auto-generated after running hugo new site my-new-site.

I’ve been through the docs and found some configuration options that I thought looked good, so I’ve pasted them in. But this doesn’t seem to work when I run hugo server. The syntax must be wrong.

Could anyone please give me a clue what’s happening and what it should look like instead?
Additionally if you have any comments on my specific configuration choices that would be great too.

Thank you. I’m working hard to learn more!

baseURL = ''
languageCode = 'en-GB'
title = 'Personal Website'
buildDrafts = true
copyright = 'stuff copyrighted ok'
enableEmoji = true
    AuthorName: Mr Person
    - banana
    - milk
    - soup
Subtitle: Let's test Hugo!
    posts: /:year/:month/:title/
    tag: tags
        disableDate: true
        disableLatLong: true

You are mixing YAML and TOML. Pick one.

1 Like

Thank you.
I see the mistake I have made now in copying from the docs. I didn’t switch from the default code examples which are YAML. I should have chosen TOML which matches the file extension that Hugo automatically produced.

I wonder why Hugo is set to product a .toml file by default, but the docs present the yaml code first.

The code toggle on docs site remembers which format you viewed last, and will use that in the future.

1 Like

Aha! Thanks :smiley:

That explains a lot! I mostly use YAML, but prefer TOML for nesting values.

1 Like

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