-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Ignore files from collection (hugo _index.md) #2727
Comments
Should be possible, agreed. |
maybe this issue #1472 would minimize the needed of this feature |
Hi everyone! |
Hi @GabriFila, the current workaround is to use https://www.netlifycms.org/docs/collection-types#filtered-folder-collections |
Thank you @erezrokah, I'll try that. |
I'm going to have a look at the suggestion to add a |
Thank you! I have little experience with React, I don't know if I could help but if you need me I'd be happy to do it! |
I used this workaround, it's easy and clean. Just do something like this in your collection config and your md files to be ignored or included: Front matter of a file to be included (I removed some lines from your example for clarity):
Front matter of a file to be excluded or filtered:
Option and fields to use into your collection config:
Pay attention to the filter option, visible label, and the visible fields in the frontmatter of the files. Now all your new files created with the CMS will include the visible label, hiding the files with visible: false for the CMS, and without any interaction with the user. |
Thank you for mentioning the |
Let us know if you resolved the problem. ¿Did you notice the filter option? |
Yes yes I solved my problem, it's still a workaround but is fine for me. If and when there will be another way I'll change it. |
Suggestion from this issue: decaporg/decap-cms#2727 (comment)
I really dislike this workaround, because it requires additional frontmatter in every page. It would be better if we could define: |
Agreed. To exclude one pages, you have to define additional frontmatter for all other pages. The workaround is also not compatible with the i18n support (beta feature). Having a default value result in creating index.md for all language types even though you only edited one language.. Would really like a fix for this. All my sites are using Hugo, and im using the i18n beta feature. So the workaround is not working for me. The problem is, as mentioned. I want to edit all my articles, but not the article list view.(since it has different fields) |
I use Hugo with i18n too and this workaround works fine. The fiter setting on collection: The field in collection: If you set it correctly, you should see I noticed that adding this only to default language is enough. |
"If you set it correctly, you should see visibleInCMS: true on every page that you save with CMS." And thats the problem. If you have configures 2 languages with i18n (nb, en). Since a default value EDIT: adding
|
I have stumbled upon the same issue. The _index.md is showing up in my collection. Has somebody found a better solution than setting an extra field since this was last discussed? |
I have a hugo site in which I have a content called "project".
My config file:
The admin is working fine and I can create/edit my projects. The issue is that the admin also show the _index.md file which is used from hugo for the list page. Also this file has different front-matter (I have a file collection for this to edit from the cms).
The solution you'd like
For hugo site should automatically excludes this file from the collection.
alternatives you've considered
Maybe a better and more generic solution for all SSGs is to have a config option to let us give an array with some files to be ignored
The text was updated successfully, but these errors were encountered: