Closed yani- closed 6 years ago
Duplicate of https://github.com/netlify/netlify-cms/issues/513
Also related: bundling image assets is #1472
This is not solved for me.
Hugo page bundle (branch) has structure like this: /parent/_index.md /parent/sub1.md /parent/sub2/_index.md /parent/sub2/inside.md
Each file produces url based on folder and filename. But most important is, that these pages have hierarchy usable in code. So I can output list of all child pages that belong to parent page.
I tried using beta feature slug and path with combination of url frontmatter, but it doesn't work.
@zabatonni can you show your config file.
I have no working config file to show:
collections:
- name: pages_en
label: Pages EN
folder: content/en
create: true
path: '{{PARENT_DIR???}}/{{PARENT_DIR2???}}/{{slug}}'
@barthc please take a look at https://gohugo.io/content-management/page-bundles/
there are 2 types of bundles and netlifycms only supports {{slug}}/index.md or {{slug}}/_index.md
I think only solution is to show folders and be able to manage (create/rename/delete) files and folders. Forestry.io does this using regex pattern when defining sidebar "collections" like this: **/*
path: '{{PARENT_DIR???}}/{{PARENT_DIR2???}}/{{slug}}'
and netlifycms only supports {{slug}}/index.md or {{slug}}/_index.md
At the moment the path config only supports placehoder as stated in the doc here
You can now specify an additional path template (similar to the slug template) to control the content destination.
You can also hardcode the directory name in the path config.
path: 'folder1/folder2/{{slug}}'
@barthc But there are hundreds of folders made dynamically by client (it was WP before, after migrating to Hugo all parent and child connections are done using folders), no way one could maintain it in config.
Another workaround is to pull the folder name from the entry. Maybe a dropdown, and then do something like
path: '{{fields.folder1}}/{{fields.folder2}}/{{slug}}'
@erezrokah does the path config support the fields.
placeholder?
ok, and if i want to move pages, or rename folders? Folder would be created only on post creation, but if there is a typo and post title is changed, how this change will reflect folder structure?
Hi @zabatonni, that workflow should be covered in https://github.com/netlify/netlify-cms/issues/3227
I have no working config file to show:
collections: - name: pages_en label: Pages EN folder: content/en create: true path: '{{PARENT_DIR???}}/{{PARENT_DIR2???}}/{{slug}}'
I too have same issue, Have you found out any solution using path and slug?
Is your feature request related to a problem? Please describe. My content is organized in page bundles:
I would like that NetlifyCMS can handle content organized this way.
Describe the solution you'd like In config.yml, I should be able to do something like this:
Describe alternatives you've considered
Additional context