decaporg / decap-cms

A Git-based CMS for Static Site Generators
https://decapcms.org
MIT License
17.81k stars 3.04k forks source link

When loading collection entries, ignore non-markdown files #278

Closed erquhart closed 7 years ago

erquhart commented 7 years ago

Currently every file in a folder based collection is expected to be an entry - even having a .keep file will break the app. Instead, the CMS should simply ignore files that are not markdown.

Requirements

Considerations

tech4him1 commented 7 years ago

We wouldn't to just ignore all markdown files that start with an underscore, because some CMS's such as Hugo use them (for example content\_index.md).

erquhart commented 7 years ago

@tech4him1 thanks for that - somehow I wasn't considering that you'd want to edit the index file in the CMS 🙄

josephearl commented 7 years ago

So the files view of the collection should only show files matching the extension defined in the collection or .md if none is defined?

What about .markdown files if I have the extension set to .md - is that something we should handle, or leave for now (also affects https://github.com/netlify/netlify-cms/issues/317)?

erquhart commented 7 years ago

@josephearl we can keep the two issues separate, but fixing both in one shot definitely works too.

josephearl commented 7 years ago

@erquhart one option then is we could allow an array of extensions for a collection (as well as a string if just a single value) - with the default changing from 'md' to ['md', 'markdown']. The first extension would be used when creating files, when listing files it match against any extension in the array; how does that sound?

erquhart commented 7 years ago

@josephearl that works!