mikefowler / gatsby-plugin-collections Goto Github PK
View Code? Open in Web Editor NEWCreate pages, with support for pagination and customizable permalinks, from a folder of Markdown files.
License: MIT License
Create pages, with support for pagination and customizable permalinks, from a folder of Markdown files.
License: MIT License
@KyleAMathews I am using this with good success in a couple of personal projects. Before I put it out into the world, I am curious about:
๐
Hi there!
As a fan of Jekyll, I was super excited to see your plugin! Unfortunately, I wasn't able to get it to work :(.
These are the errors I'm getting from running gatsby develop
error Syntax Error: Expected Name, found }
error Plugin gatsby-plugin-collections returned an error
Error: There was a problem getting content for your posts collection. This is probably not your fault.
- createPages.js:109 Object.<anonymous>
[gatsby-site]/[gatsby-plugin-collections]/lib/createPages.js:109:43
- createPages.js:32 step
[gatsby-site]/[gatsby-plugin-collections]/lib/createPages.js:32:23
- createPages.js:13 Object.next
[gatsby-site]/[gatsby-plugin-collections]/lib/createPages.js:13:53
- createPages.js:4 fulfilled
[gatsby-site]/[gatsby-plugin-collections]/lib/createPages.js:4:58
- util.js:16 tryCatcher
[gatsby-site]/[bluebird]/js/release/util.js:16:23
- promise.js:512 Promise._settlePromiseFromHandler
[gatsby-site]/[bluebird]/js/release/promise.js:512:31
- promise.js:569 Promise._settlePromise
[gatsby-site]/[bluebird]/js/release/promise.js:569:18
- promise.js:606 Promise._settlePromiseCtx
[gatsby-site]/[bluebird]/js/release/promise.js:606:10
- async.js:142 _drainQueueStep
[gatsby-site]/[bluebird]/js/release/async.js:142:12
- async.js:131 _drainQueue
[gatsby-site]/[bluebird]/js/release/async.js:131:9
- async.js:147 Async._drainQueues
[gatsby-site]/[bluebird]/js/release/async.js:147:5
- async.js:17 Immediate.Async.drainQueues
[gatsby-site]/[bluebird]/js/release/async.js:17:14
This was for a brand new gatsby website with nothing but gatsby-transformer-remark
setup.
The site was generated with the latest Gatsby (v2.0.76) following these steps:
https://www.gatsbyjs.org/docs/quick-start
gatsby-plugin-collections
was setup following your Quick Start docs:
https://github.com/mikefowler/gatsby-plugin-collections/blob/master/docs/quickstart.md
If there's something I'm missing, please let me know!
Excited to hear from you :)
Thanks!
Perhaps I've misunderstood the purpose of this plugin, but my expectation is that it creates a page for the parent directory of a set of markdown files.
My config is as follows:
{
resolve: 'gatsby-plugin-collections',
options: {
collections: [{
name: 'blog-posts',
path: 'content/blog',
permalink: ':collection/:title',
template: `${__dirname}/src/templates/post.js`
}],
},
}
I'm pretty new to graphql and gatsby so please help me understand!
When trying to use the plugin with image file types I get this error.
error Field "featuredImage" of type "File" must have a selection of subfields. Did you mean "featuredImage { ... }"?
I digged a little in the code and it's because getAvailableFrontmatterFields
returns all the frontmatter fields which includes the ones set as File, which requires more parameters.
Solution would be to just ignore or query them the right way. I don't know if that's even possible I'm not very experienced in GraphQL.
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.