Currently it is not easily possible to have markdown in frontmatter tags while using this plugin (e.g. using netlifyCMS with a markdown fields other than Body).
Currently I am creating new nodes for these frontmatter fields
However transformer remark only copies the absolutePath in case its a File node (which it clearly isnt).
So I would need some way to indicate the absolute path in the remark node or maybe have some other field conveying the path.
Currently the code only works if the markdown node has a fileAbsolutePath (see https://github.com/danielmahon/gatsby-remark-relative-images/blob/master/src/on-create-node.ts#L29), which is not the case for me and therefore the plugin crashes currently.
"gatsby-remark-relative-images" threw an error while running the onCreateNode lifecycle:
The "path" argument must be of type string. Received type undefined
Error: TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received type undefined
- validators.js:112 validateString
internal/validators.js:112:11
- on-create-node.js:15 Object.exports.onCreateNode
[gatsby-starter-netlify-cms]/[gatsby-remark-relative-images]/dist/on-create-node.js:15:42
- api-runner-node.js:330 runAPI
[gatsby-starter-netlify-cms]/[gatsby]/src/utils/api-runner-node.js:330:22
- api-runner-node.js:440 Promise.catch.decorateEvent.pluginName
[gatsby-starter-netlify-cms]/[gatsby]/src/utils/api-runner-node.js:440:17
- From previous event:
- api-runner-node.js:440 Promise.catch.decorateEvent.pluginName
[gatsby-starter-netlify-cms]/[gatsby]/src/utils/api-runner-node.js:440:9
- From previous event:
- api-runner-node.js:439
[gatsby-starter-netlify-cms]/[gatsby]/src/utils/api-runner-node.js:439:14
Currently it is not easily possible to have markdown in frontmatter tags while using this plugin (e.g. using netlifyCMS with a
markdown
fields other thanBody
). Currently I am creating new nodes for these frontmatter fields(similar to the suggestion here https://github.com/GraphCMS/gatsby-source-graphcms/issues/44#issuecomment-382309512)
However transformer remark only copies the
absolutePath
in case its aFile
node (which it clearly isnt). So I would need some way to indicate the absolute path in the remark node or maybe have some other field conveying the path. Currently the code only works if the markdown node has afileAbsolutePath
(see https://github.com/danielmahon/gatsby-remark-relative-images/blob/master/src/on-create-node.ts#L29), which is not the case for me and therefore the plugin crashes currently.