vitepress
vitepress copied to clipboard
Customize default page layout
Is your feature request related to a problem? Please describe.
The default page layout is 'doc', which is hard coded. It will easier the user's life to be able to provide an aletrnative layout so that he doesn't need to write a whole theme.
Describe the solution you'd like
Use dynamic component in VPContent, and add a config option in the themeConfig.
Describe alternatives you've considered
No response
Additional context
No response
Validations
- [X] Follow our Code of Conduct
- [X] Read the docs.
- [X] Read the Contributing Guidelines.
- [X] Check that there isn't already an issue that asks for the same feature to avoid creating a duplicate.
Can you explain a bit on what's your use case?
Also I'm not sure what you mean by this:
he doesn't need to write a whole theme.
In your PR, you are adding an option to specify a different component than VPDoc, isn't it equivalent to writing a totally custom theme?
In my case, I want to keep the nav part since you have made many efforts to make it work. Any I feel that the config of layout in the frontmatter is somehow to restrictive.
My main motivation is that I want to set frontmatters programtically, but it is readonly. So I have to use different default layouts for different sets of files using locales to specify them.
Closing due to inactivity. I think we need more clear explanation on what this issue is trying to achive. When creating custom page layout, it's better to use page
instead of doc
.