# 'hugo new' injects language code into path | multilingual site

**URL:** <https://discourse.gohugo.io/t/hugo-new-injects-language-code-into-path-multilingual-site/26416>\
**Category:** support\
**Created:** [June 21, 2020, 6:15pm UTC](https://discourse.gohugo.io/t/hugo-new-injects-language-code-into-path-multilingual-site/26416 "2020-06-21T18:15:00Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![third\_try](https://avatars.discourse-cdn.com/v4/letter/t/35a633/32.png) [@third\_try](https://discourse.gohugo.io/u/third_try)\
**Post date:** [June 21, 2020, 6:15pm UTC](https://discourse.gohugo.io/t/hugo-new-injects-language-code-into-path-multilingual-site/26416/1 "2020-06-21T18:15:00Z")

</div>

This problem has appeared before, without solution.

1. [Hugo new content multi lingual language](https://discourse.gohugo.io/t/hugo-new-content-multi-lingual-language/16432)

2. [Hugo new always put new files on /en/](https://discourse.gohugo.io/t/hugo-new-always-put-new-files-on-en/19095)

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

```auto
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.**

```auto
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.

```auto
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.

```auto
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.

```auto
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:

```auto
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.

---

<div class="post-metadata">

**Author:** ![third\_try](https://avatars.discourse-cdn.com/v4/letter/t/35a633/32.png) [@third\_try](https://discourse.gohugo.io/u/third_try)\
**Post date:** [June 21, 2020, 6:16pm UTC](https://discourse.gohugo.io/t/hugo-new-injects-language-code-into-path-multilingual-site/26416/2 "2020-06-21T18:16:21Z")

</div>

Sorry I tried to add **bold** around the **/en** in the command output. But it appears as \*\* not as bold. Please understand that. Thank you.

P.S. I edited out the \*\*. Still figuring out this site.

---

<div class="post-metadata">

**Author:** ![pamubay](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/pamubay/32/17838_2.png) [@pamubay](https://discourse.gohugo.io/u/pamubay)\
**Post date:** [June 21, 2020, 6:35pm UTC](https://discourse.gohugo.io/t/hugo-new-injects-language-code-into-path-multilingual-site/26416/3 "2020-06-21T18:35:58Z")

</div>

I tried on [hugoDocs repo](https://github.com/gohugoio/hugoDocs), it works by including the `content` dir in target path.

```auto
 ~/dev/repos/hugoDocs
hugo new -k functions content/zh/new-function.md
content/zh/new-function.md created

```

---

<div class="post-metadata">

**Author:** ![third\_try](https://avatars.discourse-cdn.com/v4/letter/t/35a633/32.png) [@third\_try](https://discourse.gohugo.io/u/third_try)\
**Post date:** [June 21, 2020, 6:47pm UTC](https://discourse.gohugo.io/t/hugo-new-injects-language-code-into-path-multilingual-site/26416/4 "2020-06-21T18:47:00Z")

</div>

HOLY SMOKES!

```auto
user@computer:~/Documents/HugoProject$ hugo new content/en/blah.md
content/en/blah.md created

user@computer:~/Documents/HugoProject$ hugo new content/jp/blah.md
content/jp/blah.md created

```

I never thought of doing that because Hugo always jammed `content` into the path, so I assumed it would always be there. Well it seems we may have solved three problems with one reply!

Thanks.

P.S. Thanks for making me feel stupid for struggling with this for about 2 hours! LOL

---

<div class="post-metadata">

**Author:** ![system](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/system/32/1_2.png) [@system](https://discourse.gohugo.io/u/system)\
**Post date:** [June 23, 2020, 6:47pm UTC](https://discourse.gohugo.io/t/hugo-new-injects-language-code-into-path-multilingual-site/26416/5 "2020-06-23T18:47:05Z")

</div>

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.
