如何在Gatsby项目中的markdownRemark中呈现链接

时间:2019-05-15 16:19:55

标签: markdown gatsby

我正在Gatsby中构建markdown Wiki。

它基于gatsby-blog启动器。它将使用markdownRemark解析/content/wiki/中的markdown文件以显示为html页面。

在组件中,我当然可以写出一个简单的文本链接,如下所示:

<Link to={`/Some_File`}>Some File</Link>

但是在我的markdown文件中,链接简单地写为:

[Some File](Some_File)

问题是,当将文本链接添加到降价文件时,单击链接会导致页面刷新。

有什么方法可以在markdown文件中呈现路由器链接?

1 个答案:

答案 0 :(得分:0)

gatsby-plugin-catch-links似乎是实现此的最佳方法(也在gatsby不和谐频道中得到证实)

自述文件:

安装

scrollSpeed 
Type: Number
Default: 20
The speed at which the window should scroll once the mouse pointer gets within the scrollSensitivity distance. Ignored if the scroll option is false.
Code examples:
Initialize the draggable with the scrollSpeed option specified:

用法

npm install gatsby-plugin-catch-links