openknowledgebe / website

Open Knowledge Belgium website
https://openknowledge.be
MIT License
4 stars 0 forks source link

CMS: Image directory structure #18

Closed jbelien closed 3 years ago

jbelien commented 3 years ago

Currently all the static files are stored in the same folder.

Files linked to an activity should be stored in an activities folder. Files linked to a story should be stored in a stories folder.

auloin commented 3 years ago

It may be possible to achieve complete isolation, i.e. create an image folder for each activity/story. See relative image paths

But doing that means that we can't reuse images that are not in the same folder. See https://github.com/netlify/netlify-cms/issues/3240

jbelien commented 3 years ago

It may be possible to achieve complete isolation, i.e. create an image folder for each activity/story.

Even better 👍

But doing that means that we can't reuse images that are not in the same folder.

I don't think this is an issue. After having a look at the current blog posts, images are not only used once.

That would make the structure even more clear. 👌

jbelien commented 3 years ago

Required structure:

content/
├── activities
│   └── openstreetmap-belgium
│       ├── index.md
│       ├── benabelshausen.png
│       ├── jonathanbelien.png
│       └── osmbe-logo.png
└── stories
    └── 20201204-test
        ├── index.md
        └── image1.png

For the CMS part, "Folder Collections Media and Public Folder" seems to do the trick.

For the page generation with Gatsby, I guess it will need some more tweaking but I don't know Gatsby enough but that should be possible according to documentation:

Some static site generators (e.g. Gatsby) work best when using relative image paths.