Migrate to Netlify Today

Netlify announces the next evolution of Gatsby Cloud. Learn more

ContactSign Up
Community Plugin
View plugin on GitHub


If your markdown files have frontmatter path param then with this plugin you obtain converted links in your Gatsby pages.

So in GitHub you keep normal links between md files. And in Gatsby you will have path links.


For example, given the following project directory structure:

├── article.md
├── notes/
├──── copyright.md


title: 'My article'
path: '/my_article'

Some text with [link](./notes/copyright.md)


title: 'My article'
path: '/copyright'

Read main [article](../article.md)

With this plugin all relative links will be transformed to:

// in ./article.md
- Some text with [link](./notes/copyright.md)
+ Some text with [link](/copyright)

// in ./notes/copyright.md
- Read main [article](../article.md)
+ Read main [article](/my_article)


npm install --save gatsby-remark-use-frontmatter-path

How to use

// In your gatsby-config.js
plugins: [
    resolve: 'gatsby-transformer-remark',
    options: {
      plugins: ['gatsby-remark-use-frontmatter-path'],
© 2023 Gatsby, Inc.