This problem has appeared before, without solution.
I’ve got a strange issue with Hugo.
I’ve setup my site as multilingual, with English and Japanese.
Here is the language info in my config.toml
DefaultContentLanguage = 'en'
[languages]
[languages.en]
contentDir = "content/en"
title = "My Website in English"
languageName = "English"
weight = "1"
[languages.jp]
contentDir = "content/jp"
title = "My Website in Japanese"
languageName = "Japanese"
weight = "2"
Everything is working amazing as far as Hugo goes, with all the content I’ve already got in it.
But when I try to make new pages something is wrong.
Hugo inserts ‘en’ into the path.
user@computer:~/Documents/HugoProject$ hugo --verbose new -k jp jp/post/file.md
INFO 2020/06/21 23:04:31 Using config file:
INFO 2020/06/21 23:04:31 attempting to create "jp/post/file.md" of "jp" of ext ".md"
/home/user/Documents/HugoProject/content/en/jp/post/file.md created
When I try to specify the content directory, I get the same result.
user@computer:~/Documents/HugoProject$ hugo --verbose new -k jp -c /home/user/Documents/HugoProject/content/ jp/post/file.md
INFO 2020/06/21 22:46:06 Using config file:
INFO 2020/06/21 22:46:06 attempting to create "jp/post/file.md" of "jp" of ext ".md"
/home/user/Documents/HugoProject/content/en/jp/post/file.md created
When I try to create a file in en, it inserts en again.
user@computer:~/Documents/HugoProject$ hugo --verbose new -k en -c /home/user/Documents/HugoProject/content/ en/post/file.md
INFO 2020/06/21 22:46:06 Using config file:
INFO 2020/06/21 22:46:06 attempting to create "en/post/file.md" of "en" of ext ".md"
/home/user/Documents/HugoProject/content/en/en/post/file.md created
When I specify the destination directory, I get the same result.
user@computer:~/Documents/HugoProject$ hugo --verbose new -k jp -d /home/user/Documents/HugoProject/content**/jp** post/file.md
INFO 2020/06/21 22:46:06 Using config file:
INFO 2020/06/21 22:46:06 attempting to create "post/file.md" of "jp" of ext ".md"
/home/user/Documents/HugoProject/content/en/post/file.md created
If I comment out the language configuration lines in the config.toml file, Hugo returns to normal function, and does not insert the ‘en’ into the path.
This is my Hugo version:
Hugo Static Site Generator v0.72.0 linux/amd64 BuildDate: 2020-05-31T18:06:12Z
Can anyone please explain what is going on? Any thought to a solution?
Also, why does it say it isn’t loading a config file, when it obviously is changing its behavior on the basis of the config.toml?
P.S. I tried taking off the ‘-k’ and removed the en.html archetype I made. But it did not solve the problem.
P.P.S. I edited out the ** mentioned below.
Thank you.