Socket
Book a DemoInstallSign in
Socket

gatsby-plugin-catch-links

Package Overview
Dependencies
Maintainers
0
Versions
520
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gatsby-plugin-catch-links

Intercepts local links from markdown and other non-react pages and does a client-side pushState to avoid the browser having to refresh the page.

latest
Source
npmnpm
Version
5.15.0
Version published
Maintainers
0
Created
Source

This plugin intercepts all local links that have not been created in React using gatsby-link, and replaces their behavior with that of the gatsby-link navigate. This avoids the browser having to refresh the whole page when navigating between local pages, preserving the Single Page Application (SPA) feel.

Example use cases:

  • A markdown file with relative links (transformed to a tags by gatsby-transformer-remark)
  • An a tag that has been created by a Content Management System (CMS) WYSIWYG editor

Installation

npm install gatsby-plugin-catch-links

How to use

// In your gatsby-config.js
plugins: [`gatsby-plugin-catch-links`]

Plugin Options

excludePattern [Regular Expression][optional]

Regular expression for paths to be excluded from being handled by this plugin.

{
  resolve: `gatsby-plugin-catch-links`,
  options: {
    excludePattern: /(excluded-link|external)/,
  },
},

Examples

  • Check out this live example Using Remark to see this plugin in action. The full source code for this example can be found here.

Keywords

gatsby

FAQs

Package last updated on 27 Aug 2025

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.