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

fix(gatsby-theme-docz): use options from gatsby-config #665

Merged

Conversation

lettertwo
Copy link
Contributor

NOTE: This is a PR against the v1 branch

Description

The gatsby-node onPreInit hook passes in two arguments, the second of which is the plugin options.

This fixes merging of options defined for gatsby-theme-docz in a project's gatsby-config.js.

@@ -17,7 +17,7 @@ const touchTemplateWithPaths = paths => async (filepath, opts) => {
await touch(dest, raw)
}

module.exports = async opts => {
module.exports = async (_ opts) => {
Copy link

Choose a reason for hiding this comment

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

Shouldn't this be async (_, opts) => { instead?

Missing the , (comma / period).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, yes it should. Fixed!

The gatsby-node `onPreInit` hook passes in two arguments, the _second_ of which is the plugin options.
@lettertwo lettertwo force-pushed the fix-v1-gatsby-theme-docz-gatsby-config-options branch from 0b7c779 to 61e862e Compare March 5, 2019 18:37
@pedronauck
Copy link
Member

thanks @lettertwo, really... btw, did you testing v1?

@pedronauck pedronauck closed this Mar 12, 2019
@pedronauck pedronauck reopened this Mar 12, 2019
@pedronauck pedronauck merged commit c694bdf into doczjs:v1 Mar 12, 2019
@lettertwo
Copy link
Contributor Author

Yes! Using v1 alpha in a project. I’ve got a few temporary hax in place to make it work, but it’s early days on the project, so I’m planning to keep up to date with the v1 progress.

@lettertwo lettertwo deleted the fix-v1-gatsby-theme-docz-gatsby-config-options branch March 12, 2019 20:16
pedronauck added a commit that referenced this pull request Mar 15, 2019
* 'v1' of github.com:pedronauck/docz:
  fix(docz-core): initialize config state on data server start (#678)
  fix(docz): add window check to useWindowSize hook (#669)
  fix(docz-theme-default): toggle active links on location change (#666)
  fix(gatsby-theme-docz): use options from gatsby-config (#665)
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