RickStrahl / SaveToAzureBlob-MarkdownMonster-Addin

Markdown Monster Addin to open or paste images from your local machine and save them in Azure Blob Storage and embed link into your post.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add ability to select folder and/or use a prescribed format for image organization

MisterJames opened this issue · comments

I would like to propose a change to the plugin that would allow me to specify explicitly the folder where I would like the file saved, or to select a prescribed format for a folder structure.

For the pre-defined folder formats I would suggest:

  1. the name of the file, created as a folder
  2. the current year, created as a folder
  3. the current year as a folder, with the current month as a folder

I would also propose a small adjustment to the image naming convention to include the file name if it is not part of the path. This could be rolled into the folder naming strategy.

As an example of each of the above with the new naming convention for a post called the-thing-i-am-writing-about.md:

/the-thing-i-am-writing-about/2016-11-abcdef123.png
/2016/the-thing-i-am-writing-about-11-abcdef123.png
/2016/11/the-thing-i-am-writing-about-abcdef123.png

This would allow users the ability to control better where their images land. I'd be happy to give this a whack if you accept PRs. :)

You know that you can change the name of the blob in the textbox on the toolbar right? You can type whatever you like there.

The default naming used is MMM/dd/yyyy/filename.ext - and if the file is pasted from Clipboard the filename is a random generated string. But you can change it.

I guess the question I have is how would you expect the UI for this to work differently than just providing the filename in a textbox (other than perhaps pre-filling with the default).

Right...but when I tried to put / to change the path it replaced the slashes (or reverted back to?) the dashes. I'll give it a try again to see if I can get it to save in subfolders in the container.

The file name is automatically updated when you select a new image, but you should be able to change it after you've selected the image and it should stick when you then save?

So I tried this out just now:

/the-thing-i-am-writing-about/2016-11-abcdef123.png

turned into:

![](https://westwindblob.blob.core.windows.net/westwindblogimages//the-thing-i-am-writing-about/2016-11-abcdef123.png)

I guess you don't want the leading slash as that interferes with the naming also on Azure:

image

If I understand how blob storage work (which isn't very much since this was my first forray into pushing stuff via code into blobs) there's no concept of folders - it's just filenames.

Closing to lack of further feedback. If you have additional info we can reopen...