Smart Attachments

unlisted

by moringchen

Automatically organize attachments to a resources folder with the same relative structure as your markdown files.

Updated 2mo agoMIT
View on GitHub

Smart Attachments for Obsidian

GitHub release (latest SemVer) License

Automatically organize your attachments into a structured resources folder that mirrors your vault's directory structure.

Demo

Features

  • Automatic Organization: Files are organized by type (images, audio, videos, documents, etc.)
  • Mirrored Structure: Attachments follow the same relative path as the markdown file they belong to
  • Duplicate Handling: Automatically renames duplicates (e.g., image.pngimage-1.png)
  • Flexible Linking: Choose between WikiLinks or standard Markdown link formats
  • External Resources: Attachments are stored outside your vault (as sibling to vault root)

How It Works

When you paste or drop a file into a markdown note:

Your Vault:
├── notes/
│   └── projects/
│       └── readme.md
└── .obsidian/

Resources Folder (created as sibling to vault):
resources/
└── images/
    └── notes/
        └── projects/
            └── pasted-image.png

The resulting markdown link:

![[resources/images/notes/projects/pasted-image.png]]

Installation

  1. Download the latest release
  2. Extract to your vault's .obsidian/plugins/ folder
  3. Enable "Smart Attachments" in Obsidian's Community Plugins settings

Configuration

Open Settings → Smart Attachments to customize:

  • Resource folder name: Change the name of the resources folder (default: resources)
  • Link format: Choose between WikiLinks or Markdown format
  • Auto-rename duplicates: Toggle automatic renaming of duplicate files

Supported File Types

The plugin automatically categorizes files into subfolders:

TypeExtensions
Imagesjpg, jpeg, png, gif, webp, svg, bmp, ico
Audiomp3, wav, ogg, flac, m4a
Videosmp4, webm, mov, avi, mkv
Documentspdf, doc, docx, xls, xlsx, ppt, pptx
Archiveszip, rar, 7z, tar, gz
Codejs, ts, py, java, cpp, c, go, rs, html, css, json, xml, yaml, yml, sql, sh, bat, ps1
OtherAll other files go to files/

Development

# Install dependencies
npm install

# Build for development
npm run dev

# Build for production
npm run build

License

MIT

For plugin developers

Search results and similarity scores are powered by semantic analysis of your plugin's README. If your plugin isn't appearing for searches you'd expect, try updating your README to clearly describe your plugin's purpose, features, and use cases.