Embed and link local files outside your obsidian vault with relative paths for cross-device and multi-platform compatibility.
- Embed external files (PDF, Images, Audio, Video) outside your obsidian vault. (Markdown file embedding is under development)
- Create links to files outside your obsidian vault that open with system default applications
- Reference files using paths relative to Home directory or Vault directory for cross-device and cross-platform compatibility
- Provide commands to add embeds or links via file picker
- Support drag & drop to create embeds or links
You can embed files using paths relative to your Home directory. For example, if your Home path is C:\Users\username
, you can embed a PDF file from C:\Users\username\SynologyDrive\work\Document.pdf
like this:
```EmbedRelativeToHome
SynologyDrive/work/Document.pdf
```
This will be rendered in Live Preview and Reading Mode as:
If your Obsidian vault is located at C:\Users\username\SynologyDrive\obsidian
, you can embed the same file using a path relative to your vault:
```EmbedRelativeToVault
../work/Document.pdf
```
Using relative paths ensures compatibility across different computers and operating systems, especially useful when syncing files with services like SynologyDrive.
- Images:
.avif
,.bmp
,.gif
,.jpeg
,.jpg
,.png
,.svg
,.webp
- Audio:
.flac
,.m4a
,.mp3
,.ogg
,.wav
,.webm
,.3gp
- Video:
.mkv
,.mov
,.mp4
,.ogv
,.webm
- PDF:
.pdf
Following Obsidian's Embed files documentation, this plugin supports parameters for controlling display behavior:
Add parameters after #
to control page number, width, and height:
```EmbedRelativeToHome
SynologyDrive/work/Document.pdf#page=3&width=100%&height=80vh
```
Add dimensions after |
to control size:
```EmbedRelativeToHome
Downloads/test.png|400
```
```EmbedRelativeToHome
Videos/test.mp4|800x600
```
If you don't need to render the file content in Reading Mode, you can create links to external files:
This is a pdf file outside of the vault:
```LinkRelativeToHome
Downloads/sample.pdf
```
This will be rendered as:
For inline links within paragraphs, use:
This is a <a class=LinkRelativeToHome>Downloads/sample.pdf</a> outside of the vault.
Which renders as:
Type "external" in the command palette to see available options:
Create embeds or links by holding modifier keys (ctrl
, shift
, ctrl+shift
) while dragging files.
Modifier keys can be customized in the plugin settings: