Skip to content

Commit

Permalink
fix: algolia regression (close #228)
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Apr 23, 2018
1 parent 438e788 commit 44b1201
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lib/prepare.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,11 @@ async function resolveOptions (sourceDir) {
)

// resolve algolia
const themeConfig = siteConfig.themeConfig || {}
const isAlgoliaSearch = (
siteConfig.themeConfig.algolia ||
Object.keys(siteConfig.locales && siteConfig.themeConfig && siteConfig.themeConfig.locales || {})
.some(base => siteConfig.themeConfig.locales[base].algolia)
themeConfig.algolia ||
Object.keys(siteConfig.locales && themeConfig.locales || {})
.some(base => themeConfig.locales[base].algolia)
)

const options = {
Expand Down Expand Up @@ -218,7 +219,7 @@ async function resolveOptions (sourceDir) {
description: siteConfig.description || '',
base: siteConfig.base || '/',
pages: pagesData,
themeConfig: siteConfig.themeConfig || {},
themeConfig,
locales: siteConfig.locales
}

Expand Down

0 comments on commit 44b1201

Please sign in to comment.