Content-Length: 248410 | pFad | https://github.com/sveltia/sveltia-cms/issues/296

D8 Inconsistent Behavior and URL Structure in Image Editor Component · Issue #296 · sveltia/sveltia-cms · GitHub
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent Behavior and URL Structure in Image Editor Component #296

Closed
RDjarbeng opened this issue Jan 9, 2025 · 4 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@RDjarbeng
Copy link
Contributor

The image editor component is not working as expected. I was hoping it would have the same behavior as the images added to a collection.

  1. URL Structure Discrepancy:
    When adding images via the image editor, the URLs generated differ from those of images uploaded as part of a collection.
    For my case my config.yml has
display_url: https://rdjarbeng.github.io/RDjarbeng
media_folder: "assets/images"  # Media files (images) will be stored here
public_folder: "/assets/images"  # URL for media files

So the images in the collection have the display_url/public_folder/image_path

But the current image picker in the posts shows public_folder/image_path.

This inconsistency results in incorrect URLs, causing images to not load as intended.

  1. Inconsistent Formats: the formats are inconsistent. When adding images to a post via drag-and-drop, two different formats are generated for the same post:

![Screenshot of picture](/assets/images/pic.png "Starlink direct to cell website")

![Screenshot](blob:https://rdjarbeng.github.io/315c4d8e-856b-48ec-9231-8f5d05badde1)

I am not sure why this happens, I am just concerned that the url structure is different causing the image not to load correctly

@kyoshino
Copy link
Member

kyoshino commented Jan 9, 2025

Will check.

@kyoshino kyoshino self-assigned this Jan 9, 2025
@kyoshino kyoshino added the bug Something isn't working label Jan 9, 2025
@kyoshino
Copy link
Member

kyoshino commented Jan 9, 2025

The Decap CMS doc says

The public_folder option specifies the folder path where the files uploaded by the media library will be accessed, relative to the base of the built site.

The base (origen) is https://rdjarbeng.github.io so you need to change public_folder from /assets/images to /RDjarbeng/assets/images. Also you need use site_url instead of display_url to make things work.

Still, Sveltia CMS probably shows wrong URLs for the images because it’s not removing the path from site_url to determine the base. (e.g. https://rdjarbeng.github.io/RDjarbeng -> https://rdjarbeng.github.io) I’ll fix it after testing with your repo with an updated config.

The blob temporary URL is supposed to be replaced with the final path when the CMS saves the entry, but it didn’t work for some reason. I’ll figure out why.

@kyoshino
Copy link
Member

Fixed the bugs in v0.53.3. And here are updates to your config and entries: RDjarbeng/RDjarbeng@main...kyoshino:RDjarbeng:sveltia-296-asset-urls

@RDjarbeng
Copy link
Contributor Author

Thanks this works. Thanks also for taking the time to modify my files so this works, much appreciated.

I've merged the commit into my repo.

Last bit of thanks for implementing the ability to add the images directly into the body of a post

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://github.com/sveltia/sveltia-cms/issues/296

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy