-
-
Notifications
You must be signed in to change notification settings - Fork 624
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
Processing markdown to replace defaults with custom components #705
Comments
Stuck at a similar problem, by replacing all images with a custom CDN component. I think the only way is to replace that stuff in beforeParse-Hook by a regex or string compare. |
@adrianrudnik you made me think to look at nuxt/cloudinary as they've done some nice integration work. In their example, they are using |
Good for you, I've given up for now. I need encode the the image URL to the CDN, sign it and attach some meta / legal info for every single one. Getting that from frontmatter to page is just loathsome right now.
I see no way to solve it. Right now my hook looks like
But no matter how I approach it, there are limitations.
The signing can also not move out of the hooks, because otherwise the private key would've be required by the frontend browser to calculate. I'll fall back to just upload the images manually and generate the required signed URL and use that in md. Also tried to look at the source from cloudinary but I cant even find the place where CidImage and so on comes from, so I'll throw the towel for now. |
Hi and thank you for the idea. I plan to refactor @nuxt/content Markdown core into a new version of @nuxt/markdown, supporting customer renderers (like https://github.com/medfreeman/remark-vue) |
I've looked around quite a bit in the docs, issues, and PRs of Nuxt-content, but can't quite find the right guidance. Any help would be appreciated.
Using custom components
I know I can include components from the
components/global
folder by typing the component names as HTML in markdown:As documented here: https://content.nuxtjs.org/writing#html
Replacing the markdown defaults with custom components
But I would like to be able to adjust some of the default elements (
h1
,h2
,etc) so that given this markdown......I can have
nuxt-content
instead use a custom component (complete with hydration) and output:Any guidance on where to begin? Should I employ a remark plugin / configuration? Use a nuxt-content hook? I'm just hoping someone will kindly point me towards the right strategy or provide an example if they've achieved this before.
Thanks!!
The text was updated successfully, but these errors were encountered: