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

gatsby-remark-relative-links

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gatsby-remark-relative-links

Rewrites absolute URLs to relative ones.

  • 0.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Rewrites absolute URLs to relative ones with remark

Why?

I created this plugin to use in tandem with remark-external-links so that any links that content creators have used absolute versions of can be corrected before that plugin's logic takes effect.

Important

Use this before gatsby-remark-external-links

Installation

yarn add gatsby-remark-relative-links

Usage

Add following to your gatsby-config.js:

    plugins: [
      {
        resolve: `gatsby-transformer-remark`,
        options: {
          plugins: [
          {
            resolve: "gatsby-remark-relative-links",
            options: {
              domainRegex: /http[s]*:\/\/[www.]*yoursite\.com[/]?/,
            }
          },
          'gatsby-remark-external-links',
          ]
        }
      },

API

options.domainRegex Required

Type: string Default: null

Regex used to decipher what domain to "relative-ize". The example provided should handle most cases.

License

MIT

Keywords

FAQs

Package last updated on 03 Jan 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