hasura / gatsby-gitbook-starter

Generate GitBook style modern docs/tutorial websites using Gatsby + MDX
https://hasura.io/learn/graphql/react/introduction/
MIT License
985 stars 376 forks source link

Use with gatsby-plugin-catch-links #31

Closed zxl634 closed 5 years ago

zxl634 commented 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.

{ 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?

zxl634 commented 5 years ago

Solved it by returning <Link to={props.href}>{link}</Link> in src/components/anchor.js instead of <a href={props.href} target="">{link}</a>.