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

[gatsby-source-wordpress] add option for custom normalizer (#3450) #5603

Merged
merged 2 commits into from
Jun 4, 2018

Conversation

Fetten
Copy link
Contributor

@Fetten Fetten commented May 30, 2018

Add a basic version to use a custom normalizer function like discussed in #3450.

We pass an object to that function, which contains the already normalized entities and also other helpful functions like createNodeId, store, cache and the plugin's options from gatsby-config.js as well.

@gatsbybot
Copy link
Collaborator

gatsbybot commented May 30, 2018

Deploy preview for using-drupal ready!

Built with commit 4f262d7

https://deploy-preview-5603--using-drupal.netlify.com

@gatsbybot
Copy link
Collaborator

gatsbybot commented May 30, 2018

Deploy preview for gatsbygram ready!

Built with commit 4f262d7

https://deploy-preview-5603--gatsbygram.netlify.com

Copy link
Contributor

@pieh pieh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apart from my inline comment another thing that I would like to see is section in README that show concrete example of using this new option

@@ -97,6 +97,10 @@ plugins: [
// Example: `["/*/*/comments", "/yoast/**"]` will exclude routes ending in `comments` and
// all routes that begin with `yoast` from fetch.
excludedRoutes: ["/*/*/comments", "/yoast/**"],
// use a custom normalizer which is applied after the built-in ones.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This description makes assumption that user is familiar with gatsby-source-wordpress codebase and what "normalizer" means in this context. It would be good to expand a little bit on when/why this should be used.

Copy link
Contributor Author

@Fetten Fetten Jun 2, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're absolutely right! Added a section to the Readme with a use case and example.

@pieh pieh merged commit a0cb081 into gatsbyjs:master Jun 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants