Skip to content

Commit

Permalink
fix: algolia check should be checking themeConfig.algolia
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Apr 23, 2018
1 parent 77515d3 commit 504c21d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
5 changes: 1 addition & 4 deletions lib/default-theme/Navbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,8 @@ import NavLinks from './NavLinks.vue'
export default {
components: { SidebarButton, NavLinks, SearchBox, AlgoliaSearchBox },
computed: {
algolia () {
return this.$themeLocaleConfig.algolia || this.$site.themeConfig.algolia || {}
},
isAlgoliaSearch () {
const algolia = this.algolia
const algolia = this.$themeLocaleConfig.algolia || this.$site.themeConfig.algolia || {}
return algolia && algolia.apiKey && algolia.indexName
}
}
Expand Down
2 changes: 1 addition & 1 deletion lib/prepare.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ async function resolveOptions (sourceDir) {

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

1 comment on commit 504c21d

@ulivz
Copy link
Member

@ulivz ulivz commented on 504c21d Apr 24, 2018

Choose a reason for hiding this comment

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

Cool ! Thanks!

Please sign in to comment.