Vitepress custom theme, multiple layouts for different pages

1.4k views Asked by At

So vitepress is a early WIP and there is currently not much in the way of documentation. I'm curious if there is anyone out there that would be able to help me with this question instead of creating an issue: Having a homepage layout and a default page layout. I know in vuepress has this option by using the following

---
layout: AnotherLayout
---
1

There are 1 answers

1
Reinaldo Deprera On

On Vitepress you have 3 already layouts:

  • home
  • doc (default)
  • page

You can set layout of a page (markdown file at /docs) using the frontmatter format:

---
layout: page
---

# My title

My paragraph lorem ipsum ...
> My blockquote ....

If layout is not specified, then default doc layout will be used.

Of course, you can create layouts without limit. See Vitepress layout documentation