Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gatsby-remark-use-frontmatter-path

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

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.

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
increased by200%
Maintainers
1
Weekly downloads
 
Created
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

Package last updated on 17 Jun 2019

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc