diff --git a/lib/default-theme/Navbar.vue b/lib/default-theme/Navbar.vue index 6a99ff4d38..62753149cc 100644 --- a/lib/default-theme/Navbar.vue +++ b/lib/default-theme/Navbar.vue @@ -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 } } diff --git a/lib/prepare.js b/lib/prepare.js index d1a193c4ce..5cfebde040 100644 --- a/lib/prepare.js +++ b/lib/prepare.js @@ -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) )