Open schindld opened 3 years ago
Could the solution to this be another structure
option? It seems that language folders were not intended to be nested. I would love to see a solution for this because right now the only option with Hugo is structure: multiple_files
, which is not my favorite.
I would use it something like this:
...
i18n:
structure: hugo # or something
locales: [en, fr]
collections:
- name: 'resources'
label: 'Resources'
folder: 'content/{{locale}}/resources' # or something
i18n: true
create: true
# I removed nested here
fields:
- { label: 'Title', name: 'title', i18n: true, widget: 'string' }
- ...
Content structure
content
├── en
│ └── resources
│ ├── _index.md
│ └── post.md
└── fr
└── resources
├── _index.md
└── post.md
@erezrokah I hope this is possible
For the time being, I reverted to a flat file system, but would still like a solution for i18n paths.
Could the solution to this be another
structure
option? It seems that language folders were not intended to be nested. I would love to see a solution for this because right now the only option with Hugo isstructure: multiple_files
, which is not my favorite.I would use it something like this:
... i18n: structure: hugo # or something locales: [en, fr] collections: - name: 'resources' label: 'Resources' folder: 'content/{{locale}}/resources' # or something i18n: true create: true # I removed nested here fields: - { label: 'Title', name: 'title', i18n: true, widget: 'string' } - ...
Content structure
content ├── en │ └── resources │ ├── _index.md │ └── post.md └── fr └── resources ├── _index.md └── post.md
@erezrokah I hope this is possible
You can just write multiple_folders or multiple_files or single_file on "structure"... Something else will return an error...🤗
@haroldao I know, it's a proposal of what could be possible :)
@haroldao I know, it's a proposal of what could be possible :)
Okay😉
Is your feature request related to a problem? Please describe.
I'm trying to find a way to get netlify-cms to understand French/English page pairs in different subfolders. I'm working with Hugo, and the way they handle translation of paths is to provide a translationKey frontmatter field that links two pages in differently named folders.
Given the following file structure:
with frontmatter for the en one like:
vs the fr one:
and the following netlify-cms config.yml:
Netlify-cms sees them as unrelated pages:
and
![image](https://user-images.githubusercontent.com/1659632/100466124-67d65d80-309e-11eb-81f5-ecee0cf74671.png)
Likewise when creating content. I fill out the English and French sides of the editor, adding different path values, and get pages with this kind of frontmatter:
src/content/en/covid-19.md
and src/content/en/covid-19.md
(not sure why description doesn't show up in the French file, but that's another issue).
The
{{slug}}
part isn't being resolved as expected. I'd expect to see covid there.Describe the solution you'd like
I'd like to see 2 things:
{{slug}}
.