jmalarcon / MIIS

Powerful file-based CMS for IIS - Your Markdown-based documentation or website in a few minutes!
https://miis.azurewebsites.net/
MIT License
31 stars 6 forks source link

Question: best strategy for images, #12

Closed wstaelens closed 6 years ago

wstaelens commented 6 years ago

What would be the best strategy to work with images when working with MIIS having multiple subfolders (e.g. multi-level navigation).

  1. Create one big directory to store all images (single flat level, no subdirectories)
/MySite
--/IMAGES
----unicorn.png
--index.md
--/Subsection
----index.md
----foo.md
--/Subsection2
----/SubSubsection3
------index.md
----index.md
----foo.md
----bar.md
  1. Create an image folder per level?
/MySite
--/IMAGES
----unicorn.png
--index.md
--/Subsection
----/IMAGES
------unicorn.png
----index.md
----foo.md
--/Subsection2
----/IMAGES
------unicorn.png
----/SubSubsection3
------/IMAGES
--------unicorn.png
------index.md
----index.md
----foo.md
----bar.md
  1. Create one big directory to store all images but add subfolders per subdirectory of the site to organize them?
/MySite
--/IMAGES
----/Subsection
------unicorn.png
----/Subsection2
------/Subsection3
--------unicorn.png
------unicorn.png
----unicorn.png
--index.md
--/Subsection
----index.md
----foo.md
--/Subsection2
----/SubSubsection3
------index.md
----index.md
----foo.md
----bar.md

Pros:

  1. simple

  2. Different images with same name in different sections are possible; If you work in a subsection you know the folder to look at and don't have to scroll each time to the top to that one images directory; If you cleanup a section, you don't have to worry that images could be used in another (sub)section.

  3. different images with same name in different sections are possible; If you cleanup a section, you don't have to worry that images could be used in another (sub)section.

Cons:

  1. No different images with same name are possible; annoying if you need to scroll each time back to that folder to use an image; removing or renaming an image can end up having subsections of your site without images.

  2. more folders

  3. Duplicate folderstructure, harder to keep in sync when renaming subsites

I think the second method is preferred. What do you think? (I ask this question with editor in mind. I know you have freedom about this but would like to put structure in it).

(+What would be a good (and valid for IIS) folder name? Images? _Images? img? .img? .Images? _img? …?)

wstaelens commented 6 years ago

For your information, currently I've implemented option 2, which has all images grouped per section. I've used the _img name for the folder.

miisedit 2

Looking forward to your comments, if any.

jmalarcon commented 6 years ago

Hi:

I don't really know which one would be better. It'll depend a lot on your requirements. For example, in my company we have set up a system for landing pages based on MIIS and we have the common images in the template's folder, and one root's subfolder per landing page with their own images in an /images subfolder per landing page. That makes sense because we can work independently on each landing page and they are transient, so they are removed when they are not needed anymore.

On commercial web pages we usually use a main /images folder (with some subfolders within it) to put all the images, so method 1. This has the advantage that you can point to them from anywhere just using / or, better, ~/, that always points to the root folder of your MIIS site (that can be a virtual app and therefore not coincident with /.

Finally, in documentation projects I use a mix of 1 and 2, so a global /images folder for the common shared images in the project (like generic screenshots) and one subfolder with its own /images subfolder for every main topic if the project is huge. That leads to a better organization and maintenance.

BTW, in any case, images related to CSS (like background images) are stored in a subfolder of the css folder for the template, logically, since CSS takes the location of the .css file as the root for relative paths.

Since you are creating and automated content tool and every single file is going to be controlled by it, maybe option 1 is the most straightforward. However if you plan to manage lots of images and you can choose one from a dialog to insert it in a .md document, then you should allow your users to create folders inside the /images folder and encourage them to use that to have some kind of order that makes sense to them or it would become unmanageable.

HTH

jmalarcon commented 6 years ago

We crossed each other, so I didn't see your answer until I sent mine :-S

Looks great!