Skip to content

libsrcdev/gatsby-remark-autolink-domains

Repository files navigation

gatsby-remark-autolink-domains

This plugin extracts images from markdown files that are parsed with gatsby-transformer-remark.

How to install

npm i --save @libsrcdev/gatsby-remark-autolink-domains

Capatibilities

  • Autolink no-scheme domains to their full URL.
  • Supports custom extraction logic via a user-defined function.

Usecases

  • Automatically convert plain domain names in markdown to clickable links.
  • Customize link extraction based on specific criteria.

Usage

Example:

// In your gatsby-config.js
plugins: [
  {
    resolve: `gatsby-transformer-remark`,
    options: {
      plugins: [
        {
          resolve: `gatsby-remark-autolink-domains`,
          options: {
            mapUrl: (domain, rest) => {
              return {
                fullUrl: `custom-full-url-for-${domain}${rest}`,
                scheme: 'anycustomscheme',
                domain: 'anycustomdomain.com',
              }
            }
          },
        },
      ],
    },
  },
];

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published