You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Including images in the markdown automatically resolves the images in the rendered component. However, including an image in the frontmatter simply passes the string to the template, page, component, etc.
I am using a component to render a list of pages, and I want an image stored relative to the md file that is specified in the frontmatter to be rendered by the component without having to hardcode the path resolving logic into the component (trying to keep it DRY).
Is there a good way of resolving the relative filepath to a rendered page so that I can require the image in the development bundle?
The text was updated successfully, but these errors were encountered:
The very quick answer is to create a context module with all your images in them and then in your md wrapper reference the filepath to pull in the image path.
Including images in the markdown automatically resolves the images in the rendered component. However, including an image in the frontmatter simply passes the string to the template, page, component, etc.
I am using a component to render a list of pages, and I want an image stored relative to the md file that is specified in the frontmatter to be rendered by the component without having to hardcode the path resolving logic into the component (trying to keep it DRY).
Is there a good way of resolving the relative filepath to a rendered page so that I can require the image in the development bundle?
The text was updated successfully, but these errors were encountered: