Comments (14)
Just tested locally.
- It seems images are scanned so these appear in the Asset Library.
- But, when looking for a specific image, the CMS fails to find it under a subdirectory.
I think images under a subdirectory that is not configured in any media_folder
(in your case, both /assets/images/
and /assets/heroes/
) should be ignored because there is no way to upload images there through the CMS UI. So, not 2 (what you see) but 1 is a bug. I’ll fix it.
from sveltia-cms.
Basically, these subfolders cannot be used until I fix this known issue mentioned in README:
Sveltia CMS currently doesn’t support field-specific
media_folder
andpublic_folder
that are mentioned as the image widget’s beta feature in the Decap CMS doc.
from sveltia-cms.
Please do not put yourself under any time pressure. I can certainly manage without the preview, at least for a certain amount of time. Since I've managed without UI for several years now. 🤣
from sveltia-cms.
1 has been solved in d24fd76 and 2 is currently an expected behaviour, so I don’t see further work here. Field-specific media_folder
and public_folder
are already on my to-do list.
from sveltia-cms.
How the media_folder
and public_folder
for the posts collection look like? As the Decap doc says, you need these properties for the collection:
path: '{{slug}}/index'
media_folder: ''
public_folder: ''
I’m testing now — one entry contains an image from the global asset folder, and another contains an image from an entry-relative path, and both displays fine:
But I’ve realized that, currently when I select a new image from the image selector, the preview becomes empty. (Once saved, it will be displayed.) It’s a different bug; I’ll fix it.
from sveltia-cms.
The problem here is the saved path is actually relative, e.g. heroes/package-manager.jpg
. It should start with /
if the image is coming from the global media folder.
from sveltia-cms.
One more note: Sveltia CMS currently doesn’t support field-specific media_folder
and public_folder
that are mentioned as the image widget’s beta feature in the Decap CMS doc. So I think there is no way to use /heros/
only for the specific hero
image field while other image fields use /assets/
.
from sveltia-cms.
But I’ve realized that, currently when I select a new image from the image selector, the preview becomes empty. (Once saved, it will be displayed.) It’s a different bug; I’ll fix it.
This bug is now fixed. I’m closing the issue as it seems like a configuration problem.
from sveltia-cms.
Hi @kyoshino,
I'm afraid it's indeed a bug. I've taken a detailed look at the issue and managed to achieve partial success. My global settings is media_folder: /assets/
and public_folder: /
. Collection settings remain unchanged with media_folder: ''
and public_folder: ''
.
Under the directory /assets/
, there are two subfolders /assets/images/
and /assets/heros/
.
With these settings, neither images nor heroes are displayed.
-
If I update the global setting to
media_folder: /assets/images/
andpublic_folder: /images/
, images are displayed, but heroes are not.
-
If I update the global setting to
media_folder: /assets/heros/
andpublic_folder: /heros/
, heroes are displayed, but images are not.
from sveltia-cms.
I think that behaviour is expected.
Collection settings remain unchanged with
media_folder: ''
andpublic_folder: ''
.
Then images are expected to be in the relative paths.
- If I update the global setting to
media_folder: /assets/images/
andpublic_folder: /images/
, images are displayed, but heroes are not.
Then images under /assets/heros/
are not scanned.
- If I update the global setting to
media_folder: /assets/heros/
andpublic_folder: /heros/
, heroes are displayed, but images are not.
Then images under /assets/images/
are not scanned.
from sveltia-cms.
But when I set my global settings to
media_folder: /assets/
public_folder: /
Both subfolders should be scanned or not?
from sveltia-cms.
But when I set my global settings to
media_folder: /assets/ public_folder: /Both subfolders should be scanned or not?
As side note, with the fix #115 (comment), both path prefixes /images/
and /heros/
are working well in markdown fields and the preview.
from sveltia-cms.
Basically, these subfolders cannot be used until I fix this known issue mentioned in README
I cannot provide an ETA for this, unfortunately.
from sveltia-cms.
Reopen for further tracking?
from sveltia-cms.
Related Issues (20)
- One of the latest updates seems to break local development HOT 4
- field with attribute widget list blocks content creation HOT 5
- Feature Request: Multifile configurations HOT 1
- local development not working after recent update HOT 4
- Regression in fields with multiple values HOT 2
- `createCommitOnBranch` is null from GitHub GraphQL API HOT 4
- Cannot Login: Authentication aborted HOT 2
- YAML: support '<<' (merge key) HOT 3
- JavaScript error on save HOT 3
- Console error introduced in @sveltia/cms > 0.21.0 HOT 2
- PKCE authentication: content is not loaded and no error at all HOT 17
- Translated slugs between locales - linked translations via a reference property. Website with localized URL. HOT 23
- Conditional fields HOT 11
- Set the maximum length of a text field HOT 6
- Migration Issue - There was an error while loading site data. - Unexpected Error HOT 5
- Write local timezone in dates when picker_utc = false HOT 4
- Follow field ordering of config when writing files HOT 2
- CMS on mount, not respecting localstorage HOT 3
- Multiple Files JSON File Structure - Localized File Collections HOT 15
- Dividers jump to another position when I change current collection HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sveltia-cms.