Multilingual support breaking permalink?

For some reason when I change to multilingual the process doesn’t automatically take an md file and create the /2021/10/21/name structure under /en or /es. However without multilingual this seems to work. Wondering what I am missing or if I should default to setting URL in the frontmatter with an alias on the en side to capture / as well?

File structure
-Content
–Posts
----en
----2021-10-21-name.md
----es
----2021-10-21-name.md

Config.toml
[permalinks]
posts= ‘/:year/:month/:day/:title’
[languages]
[languages.en]
contentDir= ‘content/posts/en’
languageName=‘English’
weight=10
[languages.es]
contentDir= ‘content/posts/es’
languageName=‘Spanish’
weight=20

Your structure is incorrect. It should be:

content/
├── en/
│   ├── posts/
│   │   ├── post-1.md
│   │   └── post-2.md
│   └── _index.md
└── es/
    ├── posts/
    │   ├── post-1.md
    │   └── post-2.md
    └── _index.md

config.toml

[permalinks]
posts = '/:year/:month/:day/:title'

[languages.en]
contentDir = 'content/en'
languageName = 'English'
weight = 10

[languages.es]
contentDir = 'content/es'
languageName = 'Spanish'
weight = 20

Also, please read:
https://discourse.gohugo.io/t/sharing-code-in-the-forums/8968

2 Likes

Thank you for the information. I appreciate it.

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