0

I tried to preview my website with

hugo server -D

when I got

Error: "C:\<directory>\Website\config.toml:1:1": unmarshal failed: Near line 0 (last key parsed ''): bare keys cannot contain '�'

I don't know what to do with this. I haven't the slightest clue in fact.

I've worked in a command line environment a decent few times before, but static websites and Hugo are both completely new to me.

Yes, that last symbol did appear as a symbol placeholder for in PowerShell too (I'm doing this in Windows (not out of choice, mind you)).

Also, the website is almost completely blank at this point, so if it's completely necessary for me to make a new site, that's fine (I can backport all of my work so far anyhow).

Edit: Here are the contents of the config file for the curious.

baseURL = "http://example.org/"
languageCode = "en-us"
title = "My New Hugo Site"
theme = "grayscale"

As you can see, I haven't even changed the defaults yet, I've only gotten so far as installing and trying a theme.

1 Answers1

1

Your config.toml likely contains a BOM (or Byte Order Mark). It's automatically inserted by some editors on Windows (such as notepad) when saving files in some character sets. The simplest way to get rid of it is to use an editor like Notepad++ to open the file, change the character set to UTF8 without BOM, remove the BOM (one or two characters at the start of the file, if they weren't automatically removed), and save the file again.

T0xicCode
  • 1,421