Socket
Socket
Sign inDemoInstall

gatsby-remark-use-frontmatter-path

Package Overview
Dependencies
15
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    gatsby-remark-use-frontmatter-path

If markdown file has a relative url to another markdown file then url will be replaced by frontmatter path value.


Version published
Weekly downloads
66
decreased by-29.79%
Maintainers
1
Install size
879 kB
Created
Weekly downloads
 

Readme

Source

gatsby-remark-use-frontmatter-path

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.

Example

For example, given the following project directory structure:

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

./article.md

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

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

./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)

Install

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'],
    },
  },
];

Keywords

FAQs

Last updated on 17 Jun 2019

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc