decaporg / decap-cms

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

CMS will only list collection in subfolder. #218

Closed ghost closed 7 years ago

ghost commented 7 years ago

So I have the following content structure:

/content/_index.md
/content/page1.md
/content/page2.md
/content/projects/project1.md
/content/projects/project2.md

The projects collection shows just fine in the cms, but the pages collection won't show. It only shows the loading animation, and the console doesn't output any errors. When I put all the pages in another folder say /content/singles/ it does work. Sadly this is not an option, since the _index.md has to be in the /content/ directory or else, Hugo won't let be render normal content on the index page.

justanothernguyen commented 7 years ago

I have the same problem while trying to setup a Hugo site.

Netlify CMS seems to expect the collection folder to contain only the .md. If you have subfolders or files (in my case I had a /post subfolder and a .keep file) CMS will stuck.

erquhart commented 7 years ago

@mgrandl are you specifying the specific files for your page collection in config.yml?

ghost commented 7 years ago

@erquhart no I am not specifying pages in the config.yml I want to be able to add pages dynamically...

erquhart commented 7 years ago

Then you'll want to use a folder based collection and specify a folder. We do need a way to ignore non-entry files, perhaps ignoring anything that begins with an underscore is a great approach for the time being.

If you're up for submitting a PR we certainly welcome it, otherwise we'll try to get to it soon.

erquhart commented 7 years ago

@mgrandl closing this unless there's anything further - conversation and work toward ignoring files can happen under #278.

ghost commented 7 years ago

@erquhart Yeah I'd use a folder based collection, but the thing is that hugo is kinda fucked up when it comes to the index page. I need to have it inside the root of my content folder and call it _index.md, otherwise it behaves like a blog page and I don't want that for a lot of my projects.

erquhart commented 7 years ago

Reopening this, I think I oversimplified things on my first read.

erquhart commented 7 years ago

I believe this was resolved by #278.