feat(theme): add not-found layout slot (#2054)

pull/2059/head
Divyansh Singh 1 year ago committed by GitHub
parent 747a04d341
commit 41987b6a88
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -126,6 +126,8 @@ Full list of slots available in the default theme layout:
- `home-hero-after` - `home-hero-after`
- `home-features-before` - `home-features-before`
- `home-features-after` - `home-features-after`
- On not found (404) page:
- `not-found`
- Always: - Always:
- `layout-top` - `layout-top`
- `layout-bottom` - `layout-bottom`
@ -135,4 +137,3 @@ Full list of slots available in the default theme layout:
- `nav-bar-content-after` - `nav-bar-content-after`
- `nav-screen-content-before` - `nav-screen-content-before`
- `nav-screen-content-after` - `nav-screen-content-after`

@ -54,6 +54,7 @@ provide('hero-image-slot-exists', heroImageSlotExists)
</VPSidebar> </VPSidebar>
<VPContent> <VPContent>
<template #not-found><slot name="not-found" /></template>
<template #home-hero-before><slot name="home-hero-before" /></template> <template #home-hero-before><slot name="home-hero-before" /></template>
<template #home-hero-info><slot name="home-hero-info" /></template> <template #home-hero-info><slot name="home-hero-info" /></template>
<template #home-hero-image><slot name="home-hero-image" /></template> <template #home-hero-image><slot name="home-hero-image" /></template>

@ -19,7 +19,7 @@ const { hasSidebar } = useSidebar()
'is-home': frontmatter.layout === 'home' 'is-home': frontmatter.layout === 'home'
}" }"
> >
<NotFound v-if="page.isNotFound" /> <slot name="not-found" v-if="page.isNotFound"><NotFound /></slot>
<VPPage v-else-if="frontmatter.layout === 'page'" /> <VPPage v-else-if="frontmatter.layout === 'page'" />

Loading…
Cancel
Save