Neat Pidgeon Manure

    gatsby-plugin-catch-links

    5.5.0 • Public • Published

    gatsby-plugin-catch-links

    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.

    Install

    npm i gatsby-plugin-catch-links

    DownloadsWeekly Downloads

    62,430

    Version

    5.5.0

    License

    MIT

    Unpacked Size

    50.1 kB

    Total Files

    10

    Last publish

    Collaborators

    • kathmbeck
    • j0sh77
    • dschau
    • kylemathews
    • pieh
    • wardpeet
    • tylerbarnes
    • fk
    • smthomas
    • lekoarts
    • rachelbahl
    • daniellewgatsby