• What you do when you want to add a new layout file When you need an additional layout, you can place the layout file on ./docs/.vitepress/theme/layout/. And difine the routing in the ./docs/.vitepress/theme/layout/Layout.vue like this. const component = computed(() => { switch (type.value) { case 'Plane': return LayoutPlane case 'Home': return LayoutHome case 'Post': return LayoutPost default: return LayoutPlane } })
  • What is this? This is a template which helps to create blogs using markdown file. Since this repo based on Vitepress, its official docs help you to understand this repo. Directory structure Basically directory structure follows Vitepress. I define some vue files which take responsible for page layout under docs/.vitepress/theme/layout/. In the layout file, it uses component files which is under the docs/.vitepress/theme/components/. Post files The blog posts need to be under the docs/posts/ dir which is defined in the docs/.vitepress/config.js const { getPostList } = require('vitepress-blog-util/scripts') function getConfig() { return { ... themeConfig: { postList: getPostList('./docs/posts') }, ... } } module.exports = getConfig()