Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

_index.md files can be created but not recognized by folder collections #206

Closed
bmackinney opened this issue Sep 27, 2024 · 4 comments
Closed
Assignees

Comments

@bmackinney
Copy link

bmackinney commented Sep 27, 2024

I saw the note in the readme, but I find this a bug.
US: As a hugo editor, I want to use the same form to edit all of my section _index.md list pages.
Workaround: I can make a files collection that edits a files collection's files field, adding a new file for each content/{{ slug }}/_index.md, and import the same fields to every file.

@kyoshino
Copy link
Member

Yes, omitting _index.md is by design, not a bug, because the special index file usually has (very) different fields from other files, right?

I could think about a different approach though: implement a filename-based filter as suggested in decaporg/decap-cms#1245, exclude _index.md by default but allow developers to override the filter. WDYT?

@bmackinney
Copy link
Author

Yes, omitting _index.md is by design, not a bug, because the special index file usually has (very) different fields from other files, right?

It has different fields than the other files in that directory, but can have the same fields as the other _index.md files in other content/subdirectories. I converted the folder collection to files, named the files and then imported the parent collections vestiged fields into the fields field and it worked. I think for those files, it's probably a good thing to have their configuration a little more hidden, so I'm good with how it works for me, but

I could think about a different approach though: implement a filename-based filter as suggested in decaporg/decap-cms#1245, exclude _index.md by default but allow developers to override the filter. WDYT?

I think:

folder: content 
path: {{slug}}/_index

the collection should be restricted to files that match that pattern.

@kyoshino
Copy link
Member

Okay, so not extra config needed, but the CMS should respect path ending with _index. I’ll do it now.

@kyoshino
Copy link
Member

v0.39.12 fixed this issue, #207, and the checkbox bug mentioned in #201 (comment). Feel free to file new issues if you see any other bugs!

@kyoshino kyoshino self-assigned this Sep 27, 2024
@kyoshino kyoshino added the bug Something isn't working label Sep 27, 2024
@kyoshino kyoshino removed the bug Something isn't working label Mar 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants