You can also access to http://localhost:8000/blog/hi/ to see the same output (description and a excerpt).
Expected behavior
Use non-undefined node.excerpt onCreateNode method
Additional context
Well, i really haven't read the process of how gatsby-mdx get the excerpt of an mdx file...so is more a question than a bug: Is it possible to use node.excerpt onCreateNode?.
This is useful, for example, If you have an optional description in the frontmatter of your mdx files and you want to use it as a description that one or else use node.excerpt. Something like:
Describe the bug Just as the title says, I have tried to use node.excerpt inside the onCreateNode method of gatsby, however it's value is
undefined
To Reproduce Link https://github.com/artmadeit/gatsby-mdx-excerpt-issue It's a very basic example of gatsby mdx using a programmatic page creation
npm run develop
This refers to https://github.com/artmadeit/gatsby-mdx-excerpt-issue/blob/e9ae2f4575995ce1c7d4adf96ecfc57e6aaf5b96/gatsby-node.js#L60
Meaning that excerpt is
undefined
, because onCreateNode sets the field.description to node.excerpt, see:https://github.com/artmadeit/gatsby-mdx-excerpt-issue/blob/e9ae2f4575995ce1c7d4adf96ecfc57e6aaf5b96/gatsby-node.js#L20
http://localhost:8000/blog/hi/
to see the same output (description and a excerpt).Expected behavior Use non-undefined node.excerpt onCreateNode method
Additional context Well, i really haven't read the process of how gatsby-mdx get the excerpt of an mdx file...so is more a question than a bug: Is it possible to use node.excerpt onCreateNode?.
This is useful, for example, If you have an optional description in the frontmatter of your mdx files and you want to use it as a description that one or else use node.excerpt. Something like:
Then just access to fields.description in my components, instead of excerpt or frontmatter.description.
Sorry for my bad english, I'm from :peru: , so spanish is what I speak... Anyway, thanks for gatsby-mdx, i've been using since it's beginnings :)