picocms / Pico

Pico is a stupidly simple, blazing fast, flat file CMS.
http://picocms.org/
MIT License
3.81k stars 615 forks source link

assets in subfolders #530

Closed sodiumchl closed 4 years ago

sodiumchl commented 4 years ago

For better organization it would be good to put images of a sub-site into its own assets folder. For example,

contents
          sub-folder1/index.md
          sub-folder1/assets/image1.png, image2.png, ....
          sub-folder2/index.md
          sub-folder2/assets/image1.png, image2.png, ....

Is it possible? How?

PhrozenByte commented 4 years ago

Please refer to Pico's user docs, http://picocms.org/docs/#creating-content

There's a distinct assets/ folder you can and should use. You can use whatever structure you prefer inside this folder. Your content/ folder isn't accessible from the outside for security reasons.

marcus-at-localhost commented 4 years ago

I'm finding myself in the same situation where I use Image Paste for Sublime Text, that writes the image from the clipboard into a markdown file as link. The image is saved relatively to the document.

blogpost-12345.md blogpost-12345/blogpost-123451.png blogpost-12345/blogpost-123452.png etc.

This makes it quite easy to create articles and not jumping between folders, copy filenames etc.

Given, this is a very specific case, there are probably other Markdown editors that simplify the process in a different way or one can optimize the process of creating documents with images by oneself.

At the end, it's easy to get around the restriction and just tweak the .htaccess to allow access to the content folder (with all security implications) and rewrite paths to the images in a plugin.

RewriteRule ^(config|content|content-sample|lib|vendor)(/|$) index.php [L]

So I guess, Pico should indeed stick to their concept of separating assets and content. (just my 2cents)

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in two days if no further activity occurs. Thank you for your contributions! :+1: