mikefowler / gatsby-plugin-collections

Create pages, with support for pagination and customizable permalinks, from a folder of Markdown files.
MIT License
11 stars 3 forks source link

Cannot read property 'entries' of undefined #2

Closed b3nab closed 5 years ago

b3nab commented 6 years ago

I receive this error when I don't add the template: post-template in markdown file from my collections. And it don't continue creating the pages.

This error is caused by the query in file src/createPages.js at line 53, because it seems to be required. If I remove template it works like a charm.

I may suggest you to try another way to include templates from markdown, and not from gatbsy-node.js.

dhoulb commented 5 years ago

FYI I get a few issues generated by that query:

Expected type MarkdownRemarkConnectionSortByFieldsEnum, found fields___date; Did you mean the enum value fields___slug?
Cannot query field "date" on type "fields"
Cannot query field "template" on type "frontmatter"

I think the date issues are because none of my *.md files are named in the yyyy-mm-dd format — it's a hierarchical directory of documentation not a list of Blog posts. Is this not designed to work with those?

mikefowler commented 5 years ago

@b3nab @dhoulb I've picked this project up again recently, and I'll be releasing a version shortly that should be free of both these issues.

mikefowler commented 5 years ago

@b3nab @dhoulb if you're still interested in giving this plugin a go, the most recent version fixes this issue and should be quite stable!

dhoulb commented 5 years ago

@mikefowler Appreciate the work but I realised I was looking something slightly different (for the plugin to model the hierarchy of files in a directory for a docs website, rather than a series of blogs) so I ended up building my own plugin.

I got a bunch of pointers from reading your code though, so thank you!

mikefowler commented 5 years ago

🤙 Right on!