-
-
Notifications
You must be signed in to change notification settings - Fork 6
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
feat: Attach export to MDXContent? #14
Comments
I suggest you take a look at |
Thanks! I couldn't quite figure out how to get that one working, so I've done it a hacky way in |
I’m glad you found a solution to your problem. Still, could you elaborate what wasn’t working for you with |
I think I didn't quite see how to but the bits together, at least on my inital look at it. I haven't given it another shot, but now I think it would roughly be:
Is that right? I think the thing that would have made me more likely to take this route would be a more complete documentation example with an (also as for timings - I played around with this yesterday, and only saw your comment suggesting |
See discussion in remcohaszing/remark-mdx-frontmatter#14
Out of interest, I ended up giving implementing this a go. In short, yes the above works: domdomegg/domdomegg.github.io@497ec45 I think using |
The distinction between I see some bugs in
|
Both good suggestions, I will look into them. I really appreciate the time you've put into reviewing the code and the kind way you've delivered the feedback! I'm initially hesitant to reimplement parts of gray-matter, given it seems widely used and recommended in this space. I suspect trying to do so myself would likely introduce more bugs rather than less! But I see in jonschlinkert/gray-matter#147 it may be a bit stuck. I agree |
Not sure whether this is in scope for this plugin - feel free to close if so.
I'm hoping to use this plugin with Next.js so that I can insert a header component using the frontmatter content. I think I currently can't access it from _app.tsx, where this is currently rendered. I could access it by adding something to every .mdx file, but this adds overhead to writing pages that I want to avoid.
To fix this, I was hoping this plugin could add it to the component itself, e.g. so rather than:
It outputs:
This is somewhat similar to what's described in https://www.josephrex.me/frontmatter-with-nextjs-and-mdx/ - although the actual component would be in _app.tsx.
This is roughly what I had in mind for my _app.tsx:
The text was updated successfully, but these errors were encountered: