Hugo new content multi lingual language

#1

If my default content language is english with config:

defaultContentLanguage = "en"
[languages.en]
  weight = 0
  languageName = "English"
  contentDir = "content/en" 
[languages.ja]
  weight = 1
  languageName = "日本語"
  contentDir = "content/ja"

then the command:

hugo new ja/posts/post.md

will generate a new post in

content/en/ja/posts/post.md

and

hugo new content/ja/posts/post.md

will generate a new post in

content/en/posts/post.md

Expected output for me is in:

content/ja/posts/post.md

it would be nice if at least one of these two commands would give the result I am expecting.
(I am aware that if I specify the full path to the content it will give the expected output.)

0 Likes

#2

I’m having trouble understanding the logic myself. no is my default language.

hugo new en/english_post.md creates a new file in
content/no/en/english_post.md, instead of the expected
content/en/english_post.md

Trying hugo new content/en/english_post.md resulted in
Error: open /english_post.md: permission denied

But hugo new ./content/en/english_post.md worked:
content/en/english_post.md created

0 Likes