Hugo new always put new files on /en/

the config file has defaultContentLanguage = "es"

and language config file

 [es]
  languageCode = "es-es"
  contentDir = "content/es"
[en]
  languageCode = "en-us"
  contentDir = "content/en"  

examples

hugo new test.md 
/snip//content/en/test.md created

hugo new es/test.md
/snip//content/en/es/test.md created

there is no way for hugo to create files correctly?

Can you share the whole config.toml ?

1 Like

the default for academic theme changing the default language to es does nothing if the language file have en and content/en folder set it will always put the new content there

# Configuration of Academic
# Documentation: https://sourcethemes.com/academic/
#
# This file is formatted using TOML syntax - learn more at https://learnxinyminutes.com/docs/toml/
# Each configuration section is defined by a name in square brackets (e.g. `[outputs]`).

# Title of your site
title = "Academic"

# The URL of your site.
# End your URL with a `/` trailing slash, e.g. `https://example.com/`.
baseurl = "/"

# Enter a copyright notice to display in the site footer.
# To display a copyright symbol, type `©`. For current year, type `{year}`.
copyright = ""

# Enable analytics by entering your Google Analytics tracking ID
googleAnalytics = ""

# Enable comments by entering your Disqus shortname
disqusShortname = ""

############################
## Advanced options below ##
############################

# Name of Academic theme folder in `themes/`.
theme = "academic"

# Get last modified date for content from Git?
enableGitInfo = false

# Default language to use (if you setup multilingual support)
defaultContentLanguage = "es"
hasCJKLanguage = false  # Set `true` for Chinese/Japanese/Korean languages.
defaultContentLanguageInSubdir = true

paginate = 10  # Number of items per page in paginated lists.
enableEmoji = true
footnotereturnlinkcontents = "<sup>^</sup>"
ignoreFiles = ["\\.ipynb$", ".ipynb_checkpoints$", "\\.Rmd$", "\\.Rmarkdown$", "_files$", "_cache$"]

[outputs]
  home = [ "HTML", "RSS", "JSON" ]
  section = [ "HTML", "RSS" ]

# Configure BlackFriday Markdown rendering.
#   See: https://gohugo.io/getting-started/configuration/#configure-blackfriday
[blackfriday]
  hrefTargetBlank = true  # `true` opens external links in a new tab. See https://github.com/gohugoio/hugo/issues/2424
	angledQuotes = false
	latexDashes = true
  extensions = ["backslashLineBreak"]

[imaging]
  resampleFilter = "lanczos"
  quality = 90
  anchor = "smart"  # Anchor for cropping. Options include Smart and Center.

# Taxonomies.
[taxonomies]
  tag = "tags"
  category = "categories"
  publication_type = "publication_types"
  author = "authors"

That config.toml is not setting any multilanguage parameters necessary for Hugo, that’s why the content is showing up where it doesn’t belong.

It should have a block that looks something like this:

[languages]
  [languages.en]
    title = "My blog"
    weight = 1
    [languages.en.params]
      linkedin = "https://linkedin.com/whoever"
  [languages.fr]
    title = "Mon blogue"
    weight = 2
    [languages.fr.params]
      linkedin = "https://linkedin.com/fr/whoever"
      [languages.fr.params.navigation]
        help = "Aide"

Take a look here: https://gohugo.io/content-management/multilingual/

language.conf file have

[es]
languageCode = “es-es”
contentDir = “content/es”
[en]
languageCode = “en-us”
contentDir = “content/en”

Alright, then you are using several files as explained here? https://gohugo.io/getting-started/configuration/#configuration-file

I haven’t used that method before.

Any chance you can share the full source code so we can run some tests?