ChristopherBiscardi / gatsby-theme-examples

Examples of using gatsby themes
141 stars 11 forks source link

overwrite #4

Closed signalwerk closed 6 years ago

signalwerk commented 6 years ago

How can I overwrite siteMetadata?

module.exports = {
  __experimentalThemes: [
    [
      "gatsby-theme-signalwerk",
      {
        root: __dirname,
        siteMetadata: {
          title: 'Not Here A',
        },
      }
    ]
  ], 

  siteMetadata: {
    title: 'Not Here B',
  },
};
signalwerk commented 6 years ago

To be clear. In the theme in templates/blog-post.js there is <h1>{post.frontmatter.title}</h1> and I would like to pass in data from the site.

signalwerk commented 6 years ago

sorry... I think this works actually

ChristopherBiscardi commented 6 years ago

I see you've found it works, but it is also intended to work. The merge function for siteMetadata does a deep merge of the keys with the site's siteMetadata being the last object merged