Giter VIP home page Giter VIP logo

obsidian-unique-attachments's Introduction

Unique attachments

This plugin for Obsidian renames attachments, making their names unique. A hash function (MD5) is used to generate the filename, so the filename is indeed unique.

If two files have exactly the same content (up to each byte), then their names will also be the same. This way, if you find two files with the same name, you can be sure that they are copies of the same file.

After processing, the filenames look something like this: 5be2a494d8c98092d803718d29fe14c0.png

This approach to naming attachments will add a bit of consistency to your notes. You might want to use this plugin in conjunction with Consistent attachments and links plugin.

After using "Rename all attachments" the plugin updates the links in all notes that used these files. Alternatively you can use ''Rename only active attachments'' to rename attachments linked only to the current active MD file.

This plugin can also delete duplicates (files that have the same content) if they are in the same folder. This will make your vault a little cleaner.

In the settings there is also an option "Rename only linked attachments". If it is enabled, you can be sure that the plugin renames only those files that are referenced in the notes in the standard markdown format. So, if no note is referenced to the file, or refers to it in wikilink format, then this file will be ignored.

The "Rename all attachments" command is only compatible with standard markdown links (![](../attachments/title.png)). Wikilinks are not supported. You can convert all wikilinks to markdown links with Consistent attachments and links plugin. ''Rename only active attachments'' command works with all kind of links and generate links based on your preferences.

How to configure

Assign a hotkey to "Unique attachments: Rename all attachments" and/or **"Unique attachments: Rename only active attachments" commands in the Obsidian Hotkeys settings.

In the plugin settings, you can set the type of attachments that will be processed. Or you can ignore some folders that you don't want to process.

How to use

Call the hotkey when you want to search and rename attachments. You will see a notification about how many files have been renamed. In the console, you can see more detailed information about what happened.

It is recommended to make a backup of your files before using this plugin.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.