Closed klaskow closed 3 years ago
Can you post your gatsby-config.js?
Hi, sure. This is my gatsby-config.js
module.exports = {
siteMetadata: {
// ...
},
plugins: [
`gatsby-transformer-sharp`,
`gatsby-plugin-react-helmet`,
`gatsby-plugin-sharp`,
{
resolve: `gatsby-plugin-emotion`,
options: {
sourceMap: true,
autoLabel: "dev-only",
labelFormat: `[local]`,
cssPropOptimization: true,
},
},
{
resolve: `gatsby-plugin-mdx`,
options: {
extensions: [`.mdx`, `.md`],
defaultLayouts: {
default: require.resolve("./src/components/layout.tsx"),
},
gatsbyRemarkPlugins: [
{
resolve: `gatsby-remark-images`,
options: {
maxWidth: 990,
},
},
{ resolve: `gatsby-remark-gifs` },
{
resolve: `gatsby-remark-vscode`,
options: {
theme: "Monokai",
},
},
],
},
},
{
resolve: `gatsby-source-filesystem`,
options: {
name: `posts`,
path: `${__dirname}/content/posts/publish`,
},
},
{
resolve: `gatsby-source-filesystem`,
options: {
name: `images`,
path: `${__dirname}/images`,
},
},
],
}
Hi, I found a solution, we should not exclude child.props["mdxType"] === "style" in return statement. Issue to close.
Hi, i wanted to add excerpt to post listing by adding
div
wrapper to my mdx files.So I created custom MDXProvider and MDXRenderer like this:
It kinda works because I get my excerpt with code, but without highlighting. But if i remove my onlyExcerpt={true} highlightings works fine, but the whole post is displayed (not only excerpt which i wanted). It works too if I duplicate custom rerenderer with the default one.
What is wrong with below condition that my highlighting doesn't work?