update default-theme: use isHomeLayout in favor of hardcoded condition

pull/4673/head
Yuxuan Zhang 6 months ago
parent f1233ab5bb
commit 930038923c
No known key found for this signature in database
GPG Key ID: 6910B04F3351EF7D

@ -16,7 +16,7 @@ const { hasSidebar } = useSidebar()
id="VPContent"
:class="{
'has-sidebar': hasSidebar,
'is-home': frontmatter.layout === 'home'
'is-home': frontmatter.isHomeLayout
}"
>
<slot name="not-found" v-if="page.isNotFound"><NotFound /></slot>

@ -29,7 +29,7 @@ const classes = ref<Record<string, boolean>>({})
watchPostEffect(() => {
classes.value = {
'has-sidebar': hasSidebar.value,
'home': frontmatter.value.layout === 'home',
'home': frontmatter.value.isHomeLayout,
'top': y.value === 0,
'screen-open': props.isScreenOpen
}

@ -52,7 +52,7 @@ export function useSidebar() {
return (
frontmatter.value.sidebar !== false &&
sidebar.value.length > 0 &&
frontmatter.value.layout !== 'home'
!frontmatter.value.isHomeLayout
)
})
@ -65,7 +65,7 @@ export function useSidebar() {
})
const hasAside = computed(() => {
if (frontmatter.value.layout === 'home') return false
if (frontmatter.value.isHomeLayout) return false
if (frontmatter.value.aside != null) return !!frontmatter.value.aside
return theme.value.aside !== false
})

Loading…
Cancel
Save