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.

Access FrontMatter datas Component MDX

See original GitHub issue

Hi ! I add the plugin remark ‘remark-frontmatter’ to use frontmatter in yaml. When i show the component, the yaml is removed so it’s ok, but i don’t know how to get datas from it… If someone can help me ❤️

My webpac config loader :

{
    loader: '@mdx-js/loader',
    options: {
        mdPlugins: [highlight, emoji, frontmatter],
        type: 'yaml',
        marker: '-',
        fence: '---',
    },
}

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:4
  • Comments:13 (6 by maintainers)

github_iconTop GitHub Comments

3reactions
silvenoncommented, Jul 26, 2018

Is exporting frontmatter an option for you? If not, why not?

export const meta = {
  date: '2018-03-01'
}

# Title

Body

That way you can easily access it while importing.

1reaction
MattMattCcommented, Jul 26, 2018

Yeap, I tried the 2 rules with OneOf Links of example for interessested it’s working ! 😄 I will go on this way, thanks you for you help 😉

Read more comments on GitHub >

github_iconTop Results From Across the Web

Frontmatter - MDX
Frontmatter. This guide explores how to support YAML frontmatter in MDX. MDX supports standard markdown syntax (CommonMark).
Read more >
Accessing MDX Frontmatter in Gatsby - Noah Gilmore
On this blog's home page I use frontmatter of all the MDX documents, which includes things like title, date, and preview text, to...
Read more >
Advanced Features: Using MDX - Next.js
Frontmatter is a YAML like key/value pairing that can be used to store data about a page. @next/mdx does not support frontmatter by...
Read more >
Adding MDX Pages | Gatsby
Using frontmatter in MDX. Importing JSX components into MDX documents; Importing MDX files into JSX components; Defining a layout. Make components available ...
Read more >
Markdown & MDX - Astro Documentation
Astro provides Markdown and MDX pages with a special frontmatter layout property that can specify a relative path (or alias) to an Astro...
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