question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Markdown Meta + Head

See original GitHub issue

Hello,

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:closed
  • Created 2 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
antfucommented, Mar 26, 2021

For me, I am doing another way around, I defined meta in the frontmatter where vite-plugin-md could infer them to the head with enabledHead: 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

0reactions
xemokacommented, Mar 26, 2021

Thank you, that fits exactly where I thought I was missing something.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found