You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Override the VPContent component - very fragile coupling
Use the page layout with a custom frontmatter key under which additional layouts can be specified - cannot control Content, workaround hack
Users
---layout: pagetype: contact---# Contact
content
Devs
MyLayout.vue
<template>
<Layout>
<templatev-if="frontmatter.type==='about'" #page-top>
about page top
</template>
<templatev-if="frontmatter.type==='about'" #page-bottom>
about page bottom
</template>
<templatev-if="frontmatter.type==='contact'" #page-top>
contact page top
</template>
<templatev-if="frontmatter.type==='contact'" #page-bottom>
contact page bottom
</template>
</Layout>
</template>
An element cannot have multiple '<template>' elements which are distributed to the same slot.eslint[vue/valid-v-slot](https://eslint.vuejs.org/rules/valid-v-slot.html)
OR
<template>
<Layout>
<template #page-top>
<templatev-if="frontmatter.type==='about'">
about page top
</template>
<templatev-if="frontmatter.type==='contact'">
contact page top
</template>
</template>
<template #page-bottom>
<templatev-if="frontmatter.type==='about'">
about page bottom
</template>
<templatev-if="frontmatter.type==='contact'">
contact page bottom
</template>
</template>
</Layout>
</template>
Is your feature request related to a problem? Please describe.
For my theme which extends the default theme, I want to have a contact page with a custom layout.
Describe the solution you'd like
Users
Devs
Effectively add custom blocks here
vitepress/src/client/theme-default/components/VPContent.vue
Lines 29 to 52 in c30e758
For example
This needs a lot of consideration, but I might propose something like
Then in VPContent,
Describe alternatives you've considered
Content
, workaround hackUsers
Devs
MyLayout.vue
OR
(Terrible maintainability)
Additional context
No response
Validations
The text was updated successfully, but these errors were encountered: