npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

gatsby-remark-pretty-link-card

v1.0.1

Published

> Sponsored by ColorBliss, the best way to [turn a picture into a coloring page](https://colorbliss.com/photo-to-coloring-page-converter).

Readme

gatsby-remark-pretty-link-card

Sponsored by ColorBliss, the best way to turn a picture into a coloring page.

Description

Generate pretty link preview cards directly from Markdown or MDX using a simple shorthand. Write [$card](https://example.com) and this plugin will fetch the target page, extract Open Graph metadata, and render a responsive card with title, description, favicon, and preview image.

Inspired by gatsby-remark-link-preview, but works without Puppeteer.

  • Cards render as semantic HTML with class names prefixed by pretty-link-card-*.
  • Minimal default CSS is shipped and auto-included by the plugin via gatsby-browser.js. You can override styles in your site’s CSS using the same class names.

No public demo site yet.

Example

Pretty link card example

Dependencies

  • If you use Markdown via gatsby-transformer-remark, add this plugin under its plugins array.
  • If you use gatsby-plugin-mdx, add this plugin under its gatsbyRemarkPlugins array.

Learning Resources

  • Gatsby Remark Plugins: https://www.gatsbyjs.com/docs/how-to/plugins-and-themes/using-a-plugin-in-your-site/
  • MDX + Gatsby Remark Plugins: https://www.gatsbyjs.com/docs/how-to/routing/mdx/#using-gatsby-remark-plugins
  • Open Graph overview: https://ogp.me/

How to install

Install from npm:

npm install gatsby-remark-pretty-link-card

Then configure depending on your content pipeline.

Using gatsby-transformer-remark:

// gatsby-config.js
module.exports = {
  plugins: [
    {
      resolve: "gatsby-transformer-remark",
      options: {
        plugins: [
          {
            resolve: "gatsby-remark-pretty-link-card",
            options: {
              // optional
              delimiter: "$card", // string used in markdown link text
              timeout: 15000, // fetch timeout in ms
            },
          },
        ],
      },
    },
  ],
};

Using gatsby-plugin-mdx:

// gatsby-config.js
module.exports = {
  plugins: [
    {
      resolve: "gatsby-plugin-mdx",
      options: {
        gatsbyRemarkPlugins: [
          {
            resolve: "gatsby-remark-pretty-link-card",
            options: {
              delimiter: "$card",
              timeout: 15000,
            },
          },
        ],
      },
    },
  ],
};

The plugin automatically includes a small stylesheet via gatsby-browser.js (styles.css). No extra steps are required.

Available options (if any)

  • delimiter (string, default: $card): The exact text inside the Markdown link that triggers a card. Example: [$card](https://example.com).
  • timeout (number, default: 15000): Timeout in milliseconds for fetching remote HTML to extract metadata.

When do I use this plugin?

Use this when you want quick, attractive link previews in blog posts or docs without manually curating images and summaries. It’s handy for “further reading” sections, bookmarks, or inline references.

Examples of usage

In Markdown/MDX content:

[$card](https://www.gatsbyjs.com)

This renders a card anchored to the link with classes like pretty-link-card-container, pretty-link-card-title, pretty-link-card-description, pretty-link-card-url, pretty-link-card-image, etc.

Styling: The plugin ships minimal defaults. Override any rule in your site CSS, e.g.:

.pretty-link-card-container {
  border-color: #ddd;
}
.pretty-link-card-title {
  font-size: 1.125rem;
}

How to develop locally

  1. Clone the repo and install dependencies.
  2. Make changes under the plugin directory.
  3. Use npm pack or npm link to test in a local Gatsby site.

How to contribute

Issues and pull requests are welcome. If you’re proposing a significant API change, please open an issue first to discuss the approach. Bug reports with reproduction steps or a minimal repo are greatly appreciated.