Closed zxl634 closed 5 years ago
Can's seem to get it to work with [https://www.gatsbyjs.org/packages/gatsby-plugin-catch-links/]().
Have tried to put it both under gatsby-pluging-mdx (see below) and alone in gatsby-config.js after installing the package, but neither seems to help.
gatsby-pluging-mdx
gatsby-config.js
{ resolve: "gatsby-plugin-mdx", options: { gatsbyRemarkPlugins: [ { resolve: "gatsby-remark-images", options: { maxWidth: 1035, sizeByPixelDensity: true, }, }, { resolve: "gatsby-remark-copy-linked-files", }, { resolve: "gatsby-plugin-catch-links", }, ], extensions: [".mdx", ".md"], }, }, Should this be able to work?
{ resolve: "gatsby-plugin-mdx", options: { gatsbyRemarkPlugins: [ { resolve: "gatsby-remark-images", options: { maxWidth: 1035, sizeByPixelDensity: true, }, }, { resolve: "gatsby-remark-copy-linked-files", }, { resolve: "gatsby-plugin-catch-links", }, ], extensions: [".mdx", ".md"], }, },
Solved it by returning <Link to={props.href}>{link}</Link> in src/components/anchor.js instead of <a href={props.href} target="">{link}</a>.
<Link to={props.href}>{link}</Link>
src/components/anchor.js
<a href={props.href} target="">{link}</a>
Can's seem to get it to work with [https://www.gatsbyjs.org/packages/gatsby-plugin-catch-links/]().
Have tried to put it both under
gatsby-pluging-mdx
(see below) and alone ingatsby-config.js
after installing the package, but neither seems to help.{ resolve: "gatsby-plugin-mdx", options: { gatsbyRemarkPlugins: [ { resolve: "gatsby-remark-images", options: { maxWidth: 1035, sizeByPixelDensity: true, }, }, { resolve: "gatsby-remark-copy-linked-files", }, { resolve: "gatsby-plugin-catch-links", }, ], extensions: [".mdx", ".md"], }, },
Should this be able to work?