Unable to locate Config file when using different file name (trying to create a multilingual site)

I opened a github issue #1513

When running hugo with specific config file (config_en.toml) that sits in the root directory (next to the default config.toml):

hugo server --theme=landing-page-hugo --buildDrafts --config="config_en"

I get the following error:

ERROR: 2015/10/21 Unable to locate Config file. Perhaps you need to create a new site. Run `hugo help new` for details
ERROR: 2015/10/21 No 'baseurl' set in configuration or as a flag. Features like page menus will not work without one.

When running it with suffix:

hugo server --theme=landing-page-hugo --buildDrafts --config=config_en.toml

I get the following error:

ERROR: 2015/10/22 Error parsing config: Near line 4 (last key parsed ''): Bare keys cannot contain '.'.

Did anyone here faced this issue before? is it a bug or something i do wrong?


You have a config key with a “.” in it. Check your config.toml.

Thanks! it works.
I think it will be good to update the guide, since my mistake was to copy from it and try it as it is before adding my stuff.
The guide has the following example:

English Config config_en.toml:

baseurl = "http://acme.com/"
title = "Acme Inc."
contentdir = "content/en"
publishdir = "public/en"
    locale = "en-US"

Anyway - thanks a lot!

I second the motion to update this page.

Which is the ‘key’ with a dot in it that can’t have a dot in it? I assume that you mean “…” but to be clear, that isn’t a key. Why not just fix it?

The other issue with this page is

Now you can reference the strings in your templates. One way is to do it like in this layouts/index.html

The above shows both techniques, using an if eq and else if eq to check the locale, and using index to pull strings from the data file that matches the locale set in the site’s config file.

There are not “both” of two techniques shown. It seems there was previously a technique that used else if but it isn’t there now.

If there is another technique, please show it.

My client is starting to complain to me about the inconsistency of the documentation and losing confidence in my assurances that Hugo is the best way to go. Clear, consistent, accurate and (eventually complete) documentation matters.

This project is based on voluntary work.

I’m not convinced that the others (Jekyll and co.) are much better, but the only guaranteed way of improving it is to do it yourself.

1 Like

I accidentally posted this to my master instead of creating a fork and pull request (I wish that little checkbox were more noticeable.

I don’t know whether you can pull from this or not. If it’s a pain, please advise how to turn this into a pull request.

We really need a pull request from you so we can have you sign the CLA to keep the license application clean. The CLA requires you to submit it to the project yourself.

These directions should help.

You may need to do a git rebase from spf13 master first.