Unable to locate Config file

  1. first i have installed hugo with brew, it seems going well

~ which hugo /usr/local/bin/hugo ➜ ~ ls -l $(which hugo) lrwxr-xr-x 1 jarrywang admin 28 Dec 8 12:32 /usr/local/bin/hugo -> ../Cellar/hugo/0.17/bin/hugo ➜ ~ hugo version Hugo Static Site Generator v0.17 BuildDate: 2016-10-07T22:42:05+08:00

  1. then i create a new site

`hugo new site journal
Congratulations! Your new Hugo site is created in “/Users/mac/journal”.
Just a few more steps and you’re ready to go:

  1. Download a theme into the same-named folder.
    Choose a theme from https://themes.gohugo.io/, or
    create your own with the "hugo new theme " command.

  2. Perhaps you want to add some content. You can add single files
    with “hugo new /.”.

  3. Start the built-in live server via “hugo server”.`

  4. i install a themes and want to create a new content
    with command-line
    hugo new about.md

the result is
Error: Unable to locate Config file. Perhaps you need to create a new site. Runhugo help newfor details. (Unsupported Config Type "")
and there are no new files in archetypes and content

please help me, thx

Hi and welcome! You just need to change to the root of your site with a cd command and you should be good to go:

$ hugo new site journal
Congratulations! Your new Hugo site is created in /tmp/journal.

Just a few more steps and you're ready to go:

1. Download a theme into the same-named folder.
   Choose a theme from https://themes.gohugo.io/, or
   create your own with the "hugo new theme <THEMENAME>" command.
2. Perhaps you want to add some content. You can add single files
   with "hugo new <SECTIONNAME>/<FILENAME>.<FORMAT>".
3. Start the built-in live server via "hugo server".

Visit https://gohugo.io/ for quickstart guide and full documentation.

# the new site command created a directory called "journal"
# go there and you can run the server...

$ cd journal

$ hugo server
Started building sites ...
=============================================================
Your rendered home page is blank: /index.html is zero-length
 * Did you specify a theme on the command-line or in your
   "config.toml" file?  (Current theme: "")
 * For more debugging information, run "hugo -v"
=============================================================
Built site for language en:
0 draft content
0 future content
0 expired content
0 regular pages created
1 other pages created
0 non-page files copied
0 paginator pages created
0 tags created
0 categories created
total in 5 ms
Watching for changes in /tmp/journal/{data,content,layouts,static}
Serving pages from memory
Web Server is available at http://localhost:1313/ (bind address 127.0.0.1)
Press Ctrl+C to stop
^C
2 Likes

thx a lot ! i have created the file successfully!

1 Like

Congratulations! There’s a lot of documentation on the site. A lot of questions are answered there (and many more here in the forums). Please feel free to ask questions if you come across something else that you don’t understand.

The other time that I encountered this issue was when I was running the command hugo server -D from the wrong folder. Check your working directory.

1 Like

The solution is to run the “new” command at the root of your app and then locate to the path of your folder like this if you create a new file in content:

hugo new ./content/nameofyourfile.extension

This topic was automatically closed after 21 hours. New replies are no longer allowed.