Skip to content
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

Documentation missing installation step #13134

Open
idahogurl opened this issue Apr 4, 2019 · 4 comments

Comments

4 participants
@idahogurl
Copy link

commented Apr 4, 2019

The documentation here https://www.gatsbyjs.org/docs/gatsby-config/#mapping-node-types fails to mention you need to install the Yaml plugin.

@pieh

This comment has been minimized.

Copy link
Contributor

commented Apr 4, 2019

Hey @idahogurl! Thanks for opening issue.

I'm not sure what's the best approach here, because that part of documentation is using Markdown, Yaml and Json as examples, but mapping is not limited to those and those are just used to illustrate mapping feature.

To me, adding installation instruction for those plugins would divert attention from the essence of content there.

@idahogurl

This comment has been minimized.

Copy link
Author

commented Apr 8, 2019

Perhaps a short comment that they require the respective plugin to be installed.

@wgao19

This comment has been minimized.

Copy link

commented Apr 29, 2019

Hi @pieh @idahogurl I encountered this issue too when I tried to add mapping to my site. I also learned that the file needs to be in the directory picked up by the gatsby-source-filesystem as well. Since I'm pretty new to Gatsby this was a #TIL for me.

What do you think of the following:

You can map between the author field in frontmatter to the id in the author.yaml objects by adding to your gatsby-config.js:

module.exports = {
  plugins: [...],
  mapping: {
    "MarkdownRemark.frontmatter.author": `AuthorYaml`,
  },
}

+ You may need to install the appropriate file transformer and source plugins for Gatsby to pick up the mapping files. This applies to other file types later mentioned in this segment as well.

Gatsby then uses this mapping when creating the GraphQL schema to enable you to query data from both sources:
@polishedwp

This comment has been minimized.

Copy link
Contributor

commented Apr 29, 2019

Hi @pieh this has happened again. See #13660.
I helped the user with a PR to their repo and worked them through the steps for the mapping to work, but I think we at least add a note to remind the read to add the plugin with a link to the gatsby-transformer-yaml. I think it would help new users.

@jlengstorf jlengstorf added this to To prioritize in Learning & Ecosystem Roadmap May 14, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.