chore: minor tweaks

pull/3404/head
Divyansh Singh 11 months ago
parent c2b4c66e79
commit 017395fea8

@ -45,8 +45,8 @@ export interface VitePressData<T = any> {
description: Ref<string> description: Ref<string>
lang: Ref<string> lang: Ref<string>
dir: Ref<string> dir: Ref<string>
isDark: Ref<boolean>
localeIndex: Ref<string> localeIndex: Ref<string>
isDark: Ref<boolean>
} }
// site data is a singleton // site data is a singleton
@ -89,14 +89,12 @@ export function initData(route: Route): VitePressData {
frontmatter: computed(() => route.data.frontmatter), frontmatter: computed(() => route.data.frontmatter),
params: computed(() => route.data.params), params: computed(() => route.data.params),
lang: computed(() => site.value.lang), lang: computed(() => site.value.lang),
dir: computed(() => route.data.frontmatter.dir || site.value.dir || 'ltr'), dir: computed(() => route.data.frontmatter.dir || site.value.dir),
localeIndex: computed(() => site.value.localeIndex || 'root'), localeIndex: computed(() => site.value.localeIndex || 'root'),
title: computed(() => { title: computed(() => createTitle(site.value, route.data)),
return createTitle(site.value, route.data) description: computed(
}), () => route.data.description || site.value.description
description: computed(() => { ),
return route.data.description || site.value.description
}),
isDark isDark
} }
} }

Loading…
Cancel
Save