picocms / Pico

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

Directory #673

Closed digitalinferno closed 10 months ago

digitalinferno commented 10 months ago

The content directory is for pages and blog posts, assets for images or other files, if I want to write a plugin that needs to store an output file (like a guestbook or message system or so on ), what is the correct directory for this task? For now I assume assets\myplugin

dkyme commented 10 months ago

If the filenames are guessable, I wouldn't use an assets Subfolder. I did that mistake with Calendar files in yml format. Like the pico-comments Plugin you better use a separate folder with the according rights.

PhrozenByte commented 10 months ago

As noted by @dkyme, this depends on what you want to store there. The assets directory is commonly used as public directory with direct file downloads enabled. The content directory should be used for Markdown pages only; unless you can store your data in Markdown and let Pico interpret these files as pages, I wouldn't use it. So if neither assets nor content fits your needs, you might want to create your own directory, like the mentioned PicoComments plugin does. Just remember creating a .htaccess file (or similar) to implement some access restriction, as also noted by @dkyme.

digitalinferno commented 10 months ago

Ok, thanks. What is the best way to deal with the images contained in a blog post? I put everything in assets

PhrozenByte commented 10 months ago

What is the best way to deal with the images contained in a blog post? I put everything in assets

Yes, correct.

github-actions[bot] commented 10 months 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: