Hugo no existing content direction configured
If you receive an error similar to the following:
$ hugo new content about.md
Error: no existing content directory configured for this project
take a look at your hugo.toml
or in new setups, config/_default/hugo.yaml
. In there, you should see a variable for contentDir
such as:
######################## i18n ####################
# Auto-detect Chinese/Japanese/Korean Languages in the content. see: https://gohugo.io/getting-started/configuration/#hascjklanguage
hasCJKLanguage: false
# Set default content directory for multilingual
contentDir: content/en/
# Set fallback if international version is not available
defaultContentLanguage: en
# Set the default language as the root rather than in folder i.e. don't use /en/
defaultContentLanguageInSubdir: false
Here you can see my contentDir is setup as en
in preparation for a multilingual site. It’s not a bad practice so I kept it and resolved the error with the following:
$ mkdir content/en
$ hugo new content/en/about.md
That should do it!