This plugin helps users easily search and insert images to editors from one or more image sources.
When editing a note and want to insert an image from Unsplash:
About front matter. Some plugins or markdown driven site generators read from front matter as metadata and maybe extract the header image or cover image from the metadata. Our insert image to frontmatter feature should be useful in those cases.
If you want to insert an image to frontmatter:
You can also set a hotkey for the "Image Inserter: Insert Image" and "Image Inserter: Insert Image in Frontmatter" command which allows you activate the command without open command palette and search it. Custom hotkeys
In the image searching modal, there's several convience shortcut key bindings.
Ctrl + n
-> select next image
Ctrl + p
-> select previous image
Ctrl + u
-> switch image provider
Ctrl + i
-> switch image quality
Search for "Image Inserter" in Obsidian's community plugins browser. Enable the plugin in your Obsidian settings (find "Image Inserter" under "Community plugins").
Copy over main.js, styles.css, manifest.json to your vault VaultFolder/.obsidian/plugins/insert-unsplash-image/.
Between your editor and Unsplash API, there is an HTTP proxy that runs on my own server. This means all your search input will send to my own server first. Please don't use this plugin if you can't accept it. The proxy server is necessary because Unsplash API requires a client ID when fetching data from it and Unsplash requires the developer to keep it secret.
If you want to host the proxy server by yourself, please refer to the proxy repo. After setup the proxy server, you can set the proxy server address on the plugin's settings tab.
You can set a customized value format for inserting in frontmatter. The default format will be "{image-url}".
# if the key is "image" and the value format is "{image-url}", it will be
---
image: "https://some-random-image-url.com"
---
# if the key is "banner" and the value format is "![[{image-url}]], it will be
---
banner: "![[https://some-random-image-url.com]]"
---
Clone the repository, run npm install
to install the dependencies, and run npm run dev
to compile the plugin and watch file changes.
See https://github.com/obsidianmd/obsidian-api for Obsidian's API documentation.
Issues and PRs welcome.
This plugin's code and documentation is released under the MIT License.