# gatsby-remark-external-links

> Automatically adds the target and rel attributes to external links in markdown.

Latest version **0.0.4** (published 2017-12-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install gatsby-remark-external-links
pnpm add gatsby-remark-external-links
yarn add gatsby-remark-external-links
bun add gatsby-remark-external-links
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.4 |
| Published | 2017-12-16 |
| First published | 2017-09-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 21 |
| Author | Jimmy Longley |
| Maintainers | jdlongley |
| Keywords | gatsby, gatsby-plugin, remark |

## Links

- npm: https://www.npmjs.com/package/gatsby-remark-external-links
- Repository: https://github.com/JLongley/gatsby-remark-external-links
- Homepage: https://github.com/JLongley/gatsby-remark-external-links#readme
- Issues: https://github.com/JLongley/gatsby-remark-external-links/issues
- npm.io page: https://npm.io/package/gatsby-remark-external-links

## Dependencies (4)

- [babel-runtime](https://npm.io/package/babel-runtime.md) ^6.26.0
- [is-relative-url](https://npm.io/package/is-relative-url.md) ^2.0.0
- [unist-util-find](https://npm.io/package/unist-util-find.md) ^1.0.1
- [unist-util-visit](https://npm.io/package/unist-util-visit.md) ^1.1.3

## Alternatives

- [@mdxeditor/editor](https://npm.io/package/@mdxeditor/editor.md) — 962.4K weekly downloads
- [mmdb-lib](https://npm.io/package/mmdb-lib.md) — 680.9K weekly downloads
- [playcanvas](https://npm.io/package/playcanvas.md) — 36.2K weekly downloads
- [@glw907/cairn-cms](https://npm.io/package/@glw907/cairn-cms.md) — 967 weekly downloads
- [markdown-to-confluence](https://npm.io/package/markdown-to-confluence.md) — 103 weekly downloads

## Recent versions

- 0.0.4 (latest) — 2017-12-16
- 0.0.3 — 2017-09-29
- 0.0.2 — 2017-09-29
- 0.0.1 — 2017-09-29

## README

# gatsby-remark-external-links
Adds the target and rel attributes to external links in markdown.

This is a gatsby port of the [remark-external-links](https://github.com/xuopled/remark-external-links) remark plugin.

## Usage 
1. Install plugin to your site:

```bash
yarn add gatsby-remark-external-links
```

2. Add following to your `gatsby-config.js`:
```js
    plugins: [      
      {
        resolve: `gatsby-transformer-remark`,
        options: {
          plugins: [
          {
            resolve: "gatsby-remark-external-links",
            options: {
              target: "_self",
              rel: "nofollow"
            }
          }
          ]
        }
      },
```

3. Restart gastby.

## API

#### options

##### target

Type: `string`
Default: `_blank`

Specifies where to display the linked URL.
The value should be on of : `_self`, `_blank`, `_parent`, `_top`

*You can specify `null` to not add the `target` attribute to your links*

##### rel

Type: `string`
Default: `nofollow noopener noreferrer`

Specifies the relationship of the target object to the link object.
The value is a space-separated list of [link types](https://developer.mozilla.org/en-US/docs/Web/HTML/Link_types).

*You can specify `null` to not add the `rel` attribute to your links*

*[When using target, consider adding rel="noopener noreferrer" to avoid exploitation of the window.opener API.](https://developer.mozilla.org/en/docs/Web/HTML/Element/a)*

## License

MIT

---
_Source: https://npm.io/package/gatsby-remark-external-links · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
