Skip to content

Commit

Permalink
fix(search): correctly detect multilang
Browse files Browse the repository at this point in the history
Close #316
  • Loading branch information
posva committed Jun 21, 2021
1 parent 5c076f4 commit c046905
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/client/theme-default/Layout.vue
Expand Up @@ -31,6 +31,11 @@ const isCustomLayout = computed(() => !!frontmatter.value.customLayout)
// home
const enableHome = computed(() => !!frontmatter.value.home)
// automatic multilang check for AlgoliaSearchBox
const isMultiLang = computed(
() => Object.keys(theme.value.locales || {}).length > 0
)
// navbar
const showNavbar = computed(() => {
const themeConfig = theme.value
Expand Down Expand Up @@ -85,7 +90,7 @@ const pageClasses = computed(() => {
<AlgoliaSearchBox
v-if="theme.algolia"
:options="theme.algolia"
:multilang="!!theme.locales"
:multilang="isMultiLang"
:key="site.lang"
/>
</slot>
Expand Down

0 comments on commit c046905

Please sign in to comment.