![Downloads](https://img.shields.io/badge/dynamic/json?logo=obsidian&color=%23483699&label=downloads&query=%24%5B%22attachment-placement%22%5D.downloads&url=https%3A%2F%2Fraw.githubusercontent.com%2Fobsidianmd%2Fobsidian-releases%2Fmaster%2Fcommunity-plugin-stats.json) ## Overview This plugin is meant to make resource placement more flexible and context-aware. Instead of forcing all new resources into a single hardcoded folder, it lets you define where resources should go based on the file or folder you’re currently working in. Rules can target individual `.md` files for per-note precision, or entire folders for broader coverage. The plugin checks the active file first, then walks up the directory tree until a matching rule is found. This plugin would likely be useful for people who like to copy-paste in images and would like some further organization. **Links** - [Plugin Page](https://community.obsidian.md/plugins/attachment-placement) - [Showcase](https://www.hunter-baker.com/pages/projects/obsidian-attachment-plugin.html) - [Help Page](https://www.hunter-baker.com/pages/other/obsidian-attachment-placement-help.html) ## How To Use Placement rules can be defined on individual files or folders. When a new resource is created: 1. The plugin checks if the active file itself has a placement rule. 2. If not, it checks the file's parent folder. 3. If not, it checks the parent folder's parent, and so on. 4. The resource is placed according to the first matching rule found. To get started with the plugin, open up the settings and define some rules for which attachments should be placed. Once there are rules set, the plugin will pay attention to new files being created and handle them according to the rules set. ## Example Given the following structure: ``` / ├── attachments/ │ ├── school/ │ ├── journal/ │ └── videogames/ ├── journal/ ├── league-of-legends/ ├── dragon-age-origins/ └── school/ └── math/ ├── factoring.md └── addition.md ``` If we are working within `addition.md`, we first check if there is a rule for `addition.md` itself. If not, we check its parent folder (`math/`), then `school/`, continuing upward until a rule is found or the root is reached. If no rule is found, the plugin uses the fallback location defined in settings. To complete the example, these are what some actual placement rules might look like: image If you'd like another example, check out the [help page](https://www.hunter-baker.com/pages/other/obsidian-attachment-placement-help.html). ## Support If you found this project helpful or enjoyable, and want to support future work, you can buy me a coffee on Ko-fi
Totally optional, always appreciated. [![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/S6S71TM9XT)