Giter VIP home page Giter VIP logo

obsidian-cloudinary-uploader's Introduction

Cloudinary Uploader for Obsidian

Downloads License

View site - Retype

License

Released under MIT by @jordanhandy.

Documentation

Documentation

What is it?

Cloudinary is a cloud storage platform that allows you to upload various media files to a storage account. The media files within this storage account can then be manipulated using Cloudinary's APIs to manipulate the data properties and metadata.

This plugin allows you to automatically upload images, video, audio and raw files pasted to Obsidian directly into your Cloudinary account (instead of stored locally). Note: There is functionality for media manipulation in this plugin using Cloudinary's custom parameters

How it Works

Single File Upload

Action GIF

Multi-file Upload

mass-note-upload.1.mp4

Configuration

  1. Disable Obsidian Safe Mode
  2. Install the Plugin
    • Install from the Obsidian Community Plugins tab
    • Manual install
      • Clone this repo
      • Install dependencies with yarn or npm
      • npm run dev will start compilation
  3. Enable the Plugin
  4. Configure the settings and set your:
    • Cloud Name
    • Upload Preset Name (Set that here)
    • Set a Folder Name
  5. Optional configuration
    • Cloudinary default transformation parameters

Unsigned vs. Signed Uploads to Cloudinary

The uploads to Cloudinary are unsigned. You can read more about that here. A signed upload would require the use of an API key and secret, and I opted against asking for that in the plugin configuration, as a choice for security reasons.

Transformations

Cloudinary allows for on-the-fly image transformations using their API. To the end-user, this is accomplished by making a simple URL modification to the resulting URL that Cloudinary gives back when an upload completes. You can read more about Cloudinary's transformation parameters here. As of version 0.2.0, you can now set a default transformation to be applied to all of your uploads with a comma-delimited list. Be mindful of syntax, as using the incorrect transformation parameters will cause your images to not render in Obsidian.

If this were to happen, this can be fixed by simply modifying the URL following the upload.

Be Mindful of your transformation token allotment. Depending on your plan, Cloudinary allows for an 'x' number of transformations to take place per month. Keep this count in mind as you apply transformations to your uploads

Thanks

Special thanks to:

  1. @Creling and their repo here. As this was my first time creating an Obsidian plugin, their base really helped.
  2. Obsidian Unofficial Plugin Developer Docs

obsidian-cloudinary-uploader's People

Contributors

creling avatar jordanhandy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

obsidian-cloudinary-uploader's Issues

Feature Request: Upload all existing assets and replace with cloudinary links

Request: In Settings or via the command palette, trigger a bulk upload of all locally referenced assets to cloudinary via the user's settings. Action should probably include a prompt to backup.

Use case: Creating a new vault from existing md docs and assets. Specifically vault via obsidian-garden (or in my case, a custom solution).

Really appreciate the plugin, and I think this would be a dramatic improvement.

Pasting file to obsidian note just add it's as normal image file inside vault, it's not uploaded to cloudinary

I can't make it work :(
Pasting file to obsidian note just add it's as normal image file inside vault, it's not uploaded to cloudinary nor link is replaced with link to image :(

note, after pasting image (in "source view") :

image

after pasting image is added to local vault:

image

My cloudinary account:

image

my configuration:

image

Upload Preset :

image

details:

Obsidian version 1.3.5
obsidian-cloudinary-uploader version 1.1.0

Update fails

Hi Jordan
The most recent update is failing for me. Obsidian says nothing more than 'failed to install plugin: Cloudinary uploader'.

New plugin name requirements

Hi @jordanhandy

Per our developer policies,
please ensure that your plugin's name does not include the word "Obsidian".
In addition, the plugin name should not include the word "Plugin", as that is unecessary duplication.
We have already modified the name of your plugin to "Cloudinary Uploader" in our records.

To maintain compliance, take the following actions:

  1. Modify the manifest.json file in your plugin repository.
  2. Generate a new release for your plugin to ensure users download the updated manifest.

If you have a idea for a different plugin name, you may also submit a pull request to the obsidianmd/obsidian-releases repository.

Thank you for your cooperation.
— the Obsidian team

Improvements

Here are some improvements you can look into:

if (files.length == 0 && !files[0].type.startsWith("text")) {

This logic seems faulty - if files.length is equal to 0 then it shouldn't be able to access files[0].

evt.preventDefault(); // Prevent default paste behaviour

Need to move this up one line.


You don't want to do this - because editor-paste runs for every paste event. Doing so will break regular pasting text.

const lines = editor.getValue().split("\n");

Instead of using getValue() and split('\n'), you should use getLine() and lineCount.

Upload failing

Hi Jordan, sorry to be a pain. Using v1.0.2 I am consistently getting a failed upload on pasting an image into Obsidian. I just get ![uploading...](3jt.nv41) in Source mode, and 3jt.nv42 could not be found in Live Preview.
I tried rolling back to 1.0.0, and 0.03 - same result. So it looks like there is something wrong my end.
This is what the Dev Console offers… Can you help?
image

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.