-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Description
We have set up a netlify instance which in general works quite well. Therefore thanks for the great project!
As we have an own implementation of a static site generation, we prefer to keep the assets near to the documentation site (.md-file) as described here.
To get this behavior we used the media_folder
and public_folder
options inside our collections. Eg.
example_collection:
name: "example_collection"
label: "Example collection"
folder: "example_collection"
create: true
extension: "md"
format: "frontmatter"
summary: "{{dirname}}/{{filename}}.md"
slug: "netlify"
path: "cake-cms/netlify/{{filepath}}/{{slug}}"
fields:
- { label: "File path", name: "filepath", widget: "string", required: true }
- { label: "Title", name: "title", widget: "string" }
- { label: "Body", name: "body", widget: "markdown" }
nested:
depth: 5
summary: '{{slug}}'
media_folder: "assets/"
public_folder: "assets/"
But with this configuration the overall media_library is ignored.
media_folder: "static/images/uploads" # Media files will be stored in the repo under images/uploads
public_folder: "/images/uploads" # The src attribute for uploaded media will begin with /images/uploads
As a result, you can upload media files in the overall media-library:
But all of these images are not available in the media library during creation of a new pages in the example_collection
:
Is this behavior intended or is this a bug? Because in our use-case it would be gread to use overall-assets also in each collection together with the specific collection media assets.
Otherwise the overall media library would make no sence in our case.