Markdown Meta + Head
See original GitHub issueHello,
I’m trying to get the “meta” key of the frontmatter in markdown files hoisted up to the route level, currently a meta
yaml keyword in a .md
file is ignored, and a
<route>
meta:
customMeta: "value"
</route>
is required elsewhere in the markdown file; perhaps I’m missing something? How could you control the layout that generates the markdown without a separate <route> component?
One could provide a wrapper .vue for vite-plugin-md that hoists the meta up, but, again, I have a feeling I’m missing something.
Thanks.
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Markdown metadata format - Stack Overflow
The most consistent form of metadata that I've found for Markdown is actually HTML meta tags, since most Markdown ...
Read more >A Guide for Writing Metadata Description with Markdown Editor
This guide shows how you can use it. Table of Contents. Basic Markdown formatting; Headers; Emphasis; Lists; Links; Images; Code
Read more >Metadata
The Base Header Level metadata tells MultiMarkdown to change the largest division level to the specified value. This can also be useful when...
Read more >Head Metadata customized title! - Docusaurus
The Markdown pages' description metadata may be used in more places than the head metadata. For example, the docs plugin's generated category ...
Read more >2.2 R Markdown anatomy - Bookdown
The YAML metadata (also called the YAML header) is processed in many stages of the rendering process and can influence the final document...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
For me, I am doing another way around, I defined meta in the frontmatter where
vite-plugin-md
could infer them to the head withenabledHead: true
. Then I apply frontmatter to the route’s meta for other route-based logics.You can how I do it on my site here:
https://github.com/antfu/antfu.me/blob/9f0434ea0c06699f1e9f2b31c2a107dc6d3b50e9/vite.config.ts#L58-L60 https://github.com/antfu/antfu.me/blob/9f0434ea0c06699f1e9f2b31c2a107dc6d3b50e9/vite.config.ts#L70
Hope that works for you
Thank you, that fits exactly where I thought I was missing something.