Yuto Takagi126 downloadsPaste a URL and pick how it lands: a preview card with title, description and thumbnail, a Markdown link with the page title, or the plain URL.
Paste a URL and pick how it lands in your note:
| Choice | Result |
|---|---|
| Card | A preview card with the page title, description, thumbnail and site icon |
| Link | [Page title](https://…) — a Markdown link with the title filled in |
| Plain URL | The URL exactly as pasted |
The URL is pasted immediately and the menu opens at the cursor. Pressing Esc or clicking elsewhere keeps the plain URL, so the plugin never gets in the way of an ordinary paste.
In Obsidian, open Settings → Community plugins, select Browse, search for Link or Card, then select Install and Enable. If community plugins are still off, turn them on there first.
Works on desktop and mobile.
Copy main.js, manifest.json and styles.css from the latest release into <vault>/.obsidian/plugins/link-or-card/, then enable Link or Card under Settings → Community plugins.
Copy a URL, paste it into a note, and choose Card, Link or Plain URL from the menu. Dragging a link from a browser into a note opens the same menu at the drop point.
The menu does not appear when the paste is clearly something else:
](, < or href="Inside a table, Card is not offered: a card is a multi-line block and would split the row. Link and Plain URL work as usual.
When the URL points to this computer or a local network (such as localhost, *.local, *.internal or a private IP address), the menu says so at the top, so fetching it is a deliberate choice.
Converting a card to a link reuses the title stored in the card, so no request is made.
If a card was made while the site was down, or the page has changed, right-click the card:
Both ask first and name the site that will be contacted, since a card in a shared or synced vault may have been written by someone else. Cards that point to a private or local address (loopback, private and link-local IP ranges, localhost, *.localhost, *.local, *.internal, or a name without a dot) are not refreshed. To fetch such a page anyway, convert the card to a plain URL and back to a card.
The same actions are available as the commands Refresh card at cursor and Refetch all fields of the card at cursor.
Open a note with ```cardlink blocks and run **Convert Auto Card Link blocks in this note**. Each block becomes a ```linkcard block with the same URL, title, description, image and icon, without contacting the sites. The conversion is a single edit, so one undo restores the note.
Blocks that cannot be read safely, such as ones without a url or with multi-line YAML, are left as they are and counted in the notice. Blocks shown inside other code blocks are not touched.
A card is a fenced code block with one key: value per line:
```linkcard
url: https://obsidian.md/
title: Obsidian - Sharpen your thinking
description: The free and flexible app for your private thoughts.
image: https://obsidian.md/images/banner.png
favicon: https://obsidian.md/favicon.ico
site: Obsidian
```
url is required. Edit any line by hand to change what the card shows.Domain lists take one site per line. A site also covers its subdomains, so example.com matches www.example.com but not myexample.com. Pasting a full URL into the list works too; only its host is used. When a URL matches more than one list, the most specific site wins.
To build a card or a titled link, or to refresh a card after you confirm it, the plugin sends one GET request to that URL, using Obsidian's requestUrl, and reads the page's <title>, Open Graph and Twitter card tags. Nothing is sent anywhere else, and no request is made when you choose Plain URL, close the menu, or convert Auto Card Link blocks.
Card images and icons are loaded from the sites that host them, with referrerpolicy="no-referrer".
Some sites return little or no metadata to requests that are not from a browser. The card then falls back to the host name, and the link falls back to the plain URL with a notice.
npm install
npm run dev # rebuild on change
npm run check # typecheck, tests, review checks and production build
See CHANGELOG.md for what changed in each release.
MIT