Skip to content
This repository has been archived by the owner on May 24, 2020. It is now read-only.

Commit

Permalink
Don't load gatsby-config from components, seriously.
Browse files Browse the repository at this point in the history
  • Loading branch information
millette committed Aug 12, 2018
1 parent 7b1ce4f commit bcaca3e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/i18n/redirect.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ import browserLang from 'browser-lang'
// self
import { languages } from './index'
// FIXME: should probably use GraphQL instead
import { siteMetadata } from '../../gatsby-config'
// import { siteMetadata } from '../../gatsby-config'

const { language: { fallback } } = siteMetadata
// const { language: { fallback } } = siteMetadata
const fallback = 'en'

class Redirect extends PureComponent {
constructor (props) {
Expand Down
5 changes: 3 additions & 2 deletions src/i18n/with-intl.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ import { IntlProvider, addLocaleData } from 'react-intl'
// self
import { localeData } from './locales'
// FIXME: should probably use GraphQL instead
import { siteMetadata } from '../../gatsby-config'
// import { siteMetadata } from '../../gatsby-config'

// FIXME: should probably use GraphQL for this
const { language: { fallback } } = siteMetadata
// const { language: { fallback } } = siteMetadata
const fallback = 'en'

addLocaleData(localeData)

Expand Down

0 comments on commit bcaca3e

Please sign in to comment.