Closed BlueFrog130 closed 3 months ago
@BlueFrog130 Thanks for the heads-up! Many things are unclear in the Decap docs. I’m aware of at least one issue with file collections:
(I think the i18n config has the same issue/limitation.)
Regardless of the Decap implementation, I’m happy to get rid of the limitation in Sveltia. 🙂
@BlueFrog130 Can you paste a snippet of your configuration to make sure I’m on the same page as you?
@kyoshino
Here is a snippet that I am using:
collections:
- label: Settings
name: settings
icon: Settings
# Should the folder config be here
media_folder: /src/uploads/settings
public_folder: /uploads/settings
files:
- label: Website Settings
name: settings
file: content/settings/settings.json
# or here?
media_folder: /src/uploads/settings
public_folder: /uploads/settings
editor:
preview: false
fields:
...
Thanks! The media_folder
and public_folder
options for the collection itself should work at least in Sveltia. These options for each file are not supported at this time.
- label: Settings
name: settings
icon: Settings
media_folder: /src/uploads/settings
public_folder: /uploads/settings
files:
- label: Website Settings
name: settings
file: content/settings/settings.json
editor:
preview: false
fields:
- name: title
label: Title
widget: string
- name: image
label: Image
widget: image
Here’s a screenshot of my local testing:
Odd, my image uploads are going in the default media folder
media_folder: /src/uploads
public_folder: /uploads
collections:
- label: Settings
name: settings
icon: Settings
media_folder: /src/uploads/settings
public_folder: /uploads/settings
files:
- label: Website Settings
name: settings
file: /content/settings/settings.json
editor:
preview: false
fields:
- label: Site Title
name: title
widget: string
- label: Site Description
name: description
widget: text
- label: Site Favicon
name: favicon
widget: image
Perhaps due to the backslash weirdness on Windows. Will check.
I was able to reproduce the problem locally. For some reason, it fails when a file collection is the first collection. Fix coming.
@kyoshino
You the best. This project is awesome and I plan to use it a bunch.
Keep up the great work 👍
As of now, the media_folder and public_folder properties are not respected for file collections, is this something that is planned on being implemented?
I don't see any documentation on Decap specifically for media/public folders in file collections.
I haven't done much digging, but I assume the process for saving file collection assets would be the same as folder collections.