martinheidegger / markdown-it-replace-link

markdown-it plugin for replacing links (image & text) in the markdown document.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Question: Is it possible to read the frontmatter of the file?

macmartine opened this issue · comments

I'm wanting to change the links to use the permalink attribute from the frontmatter.

Is there a way I can read the frontmatter from within 'replaceLink' ?

ya same. Would be helpful to be able to access {lang} in my case since all my files are /{lang}/filename slugs

This package purposefully limits the scope in which it acts. I am not sure if markdown-it offers an API to read frontmatter and am quite busy with other things. Do you mind investigating if that is an option?