vite-plugin-vue-layouts
vite-plugin-vue-layouts copied to clipboard
Frontmatter Layout Control
If I'm not mistaken -- and maybe I am as I'm just getting to the implementation of this -- this plugin uses the router as the primary source to determine which layout to use and I can understand that this is indeed a useful pattern particularly as the "primary pattern" to manage layouts.
If, however, you want to change this at the individual page though it would be really nice if this were able to interact with the defacto Markdown meta format of Frontmatter. Because I've always paired this plugin with vite-plugin-pages
and vite-plugin-md
I always just assumed this would be there but I believe it is not.
To be clear, what I'd like to see is that when a markdown file has a layout
prop defined in Frontmatter it overrides the route based configuration.
---
title: My Post
layout: special
---
# Hello World
Am I just being a numpty and this is in fact supported? Is this something you've considered before? Would you consider?
Note: the only way i know of to do this atm is to put this into a Markdown file:
<route lang="yaml">
meta:
layout: 404
</route>
This shifts it but is quite awkward for Markdown ... absolutely fine for VueJS based pages.
Note: i had Anthony approve a PR on vite-plugin-md
which opens this a bit (quite indirectly) and hope to have another much bigger PR on vite-plugin-md
soon which makes this more explicit.
@yankeeinlondon hi! Has the layout of MD been supported? In my current situation, even if the layout is set, it is still the default layout!As follows, it was actually Deault
If anyone needs this and wants to do a PR, I'd be happy to review. I don't want to add any dependencies to this package