Skip to content

Commit

Permalink
chore(docs): update link to merge-gatsby-config (#24529)
Browse files Browse the repository at this point in the history
  • Loading branch information
anishagg17 committed May 27, 2020
1 parent 6982d73 commit 2a92fd5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/docs/theme-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ Themes at their core are an algorithm that merges multiple `gatsby-config.js` fi

The first example results in a final ordering of `['gatsby-theme-parent', 'gatsby-theme-child']` (parents always come before their children so that children can override functionality), while the second example results in `['gatsby-theme-blog', 'gatsby-theme-notes']`.

Once you have the final ordering of themes you merge them together using a reduce function. [This reduce function](https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby/src/utils/merge-gatsby-config.js) specifies the way each key in `gatsby-config.js` will merge together. Unless otherwise specified below, the last value wins.
Once you have the final ordering of themes you merge them together using a reduce function. [This reduce function](https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby/src/utils/merge-gatsby-config.ts) specifies the way each key in `gatsby-config.js` will merge together. Unless otherwise specified below, the last value wins.

- `siteMetadata` and `mapping` both merge deeply using lodash's `merge` function. This means a theme can set default values in `siteMetadata` and the site can override them using the standard `siteMetadata` object in `gatsby-config.js`.
- `plugins` are normalized to remove duplicates, then concatenated together.

0 comments on commit 2a92fd5

Please sign in to comment.