External links
An external link is a standard web link targeting for example a website. For example, https://en.wikipedia.org/wiki/South_China_Sea is an external link to a Wikipedia page.
To create a link without a custom text:
- Press in the Formatting toolbar, or press Ctrl+K:
- Since v0.107.0, the Add link dialog opens on Web page, in a popup next to the cursor on desktop. Type or paste the address, and optionally a Link title; without one, the link shows its address. The Paste button at the end of the address field replaces its text with the text on the clipboard. This button is shown only where Trilium can read the clipboard: in the desktop app, and in a browser over HTTPS unless access to the clipboard was blocked.
- When you leave the address field, or paste with the Paste button, an empty Link title is filled with the title of the web page; a spinner at its end shows while it loads. A title you type is kept. To turn this off, go to Options → Text Notes and turn off Automatically retrieve titles for text links in the Features section.
- Display as inserts the address as Text, or as one of the Link Previews: Icon & text, Card or, for a YouTube video or the address of an audio or video file, Embed.
- Press Enter or Insert link to confirm.
- Alternatively, use Slash Commands and choose Link to a web page, which opens the same dialog. Link to a web page (with icon) and Link to a web page (as a card) open it with that display already picked.
- A simpler way is to paste the raw link and press space to turn it automatically into a link.
- The button and Ctrl+L of Internal (reference) links open the same dialog on Note. Select Web page at the top of the dialog to create an external link from there.
An address without a scheme, such as example.com, gets https://. The dialog does not insert an address that is not a valid URL, or a javascript:, vbscript: or data: link, since those can run code, and shows the reason under the address field. A URL pasted into the Note field, or picked from its search, switches the dialog to Web page. The dialog also opens on Web page when the selected text is a URL.
To create a link with a custom text:
- First, type and select the text which will be turned into a link.
- Open the Add link dialog as above (via the formatting toolbar, or Ctrl+K). The selected text becomes the text of the link, so the dialog does not offer Display as.
- Alternatively, simply paste (Ctrl+V) over the selected text to turn it into a link.
Once a link is inserted:
- The text inside the link can be changed if needed but the link itself will remain.
- To modify the link, click on the link to display the popup and press the Edit link button. It opens the Edit link dialog, filled with the link's address and text, as do placing the cursor inside the link and pressing Ctrl+K, Ctrl+L or one of the link buttons. Save link changes the whole link, its text included, and the dialog can also turn it into a link to a note.
- To remove a link, click on it, open the More actions menu at the end of the popup and choose Unlink. The text stays, without the link.
- The same menu has Open link, Edit link and Copy address (URL), and Display as, which turns the link into one of the Link Previews, as does the Display menu of the popup.
- Right-clicking a link opens the same menu.
To follow an external link in a note being edited, Ctrl+click or double-click it, which opens it in a new tab or window, place the cursor in it and press Alt+Enter, or right-click it and choose Open link. On a touch device, touch and hold the link, then choose Open link. A link in an included note that is not Editable opens on a click, as in a read-only note.