-
-
Notifications
You must be signed in to change notification settings - Fork 935
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[bug]Markdown file with specified layout will render extra text. #67
Comments
You can't just write custom block to markdown file because it will transform into // vite.config.js plugin
Pages({
extendRoute: (route) => {
if (route.component.endsWith('pages/test.md')) {
route.meta.layout = 'home'
}
}
}) |
@hannoeru Yah I got it, thanks. So is there another way to specify custom layout directly inside of a markdown file? I tried YAML meta head just like how jekyll does, and it doesn't work as expected. Maybe I should check out the markdown plugin source code. |
Would it be a big change for the vite-markdown plugin to strip out the route block? |
I had to slightly modify @hannoeru snippet to get things working, hopefully this helps someone else : //vite.config.ts
Pages({
extensions: ['vue', 'md'],
extendRoute: (route) => {
if (/.*\/mydirname\/.*\.md/.test(route.component)) {
route.meta = { layout: 'mylayout' }
}
},
}), |
With vite-plugin-md v0.5.0, now you can write route custom block inside markdown file!! markdown: # Hello World
<route lang="yaml">
meta:
layout: home
</route> |
Bug report
Markdown file with specified layout will render extra text.
1、Add a new page like
pages/test.md
2、Can avoid by adding a
hidden
class:Reproduction repo
vitesse-md-with-layout
The text was updated successfully, but these errors were encountered: