sveltia / sveltia-cms

Alternative to Netlify/Decap CMS. Fast, lightweight, Git-based headless CMS. Modern UX, first-class i18n support, open source & free. Made with Svelte.
MIT License
750 stars 34 forks source link

public_folder automatically prepended by / #72

Closed zanhk closed 7 months ago

zanhk commented 8 months ago

In decap cms I was used to set media and public image folder like this:

media_folder: "src/assets/images"

public_folder: "@assets/images"

As they are placed inside src folder and processed, the decap cms output was something like this

heroImage: "@assets/images/blog-placeholder-3.jpg"

https://github.com/zankhq/astro-starter/blob/chore/sveltia/src/content/blog/it/first-post.md

In sveltia a / is automatically addead at the start of the string resulting in

heroImage: /@assets/images/blog-placeholder-2.jpg

This break the page as /@assets/images/blog-placeholder-2.jpg it's not a valid path.

Is there a way to fix it or some workaround?

Thanks

kyoshino commented 7 months ago

The fix is in!

zanhk commented 7 months ago

@kyoshino Awesome thanks, when back home I ll try again

zanhk commented 7 months ago

@kyoshino It works! Thanks

zanhk commented 7 months ago

Hi @kyoshino, This is just a minor detail but looks like that sometimes the preview image is not visible as it point to

image

@assets/images/blog/blog-placeholder-3.jpg

image


Clearing site data seem to solve the problem

image

as after cleaning the site data the image source is settet like this

image

blob:https://astrostarter.zank.studio/b3d11537-ce63-46b0-9cde-a1d9e1813658

is there a way to make sure it's always setted like this?


repo link: https://github.com/zankhq/astro-starter admin page: https://astrostarter.zank.studio/admin/

kyoshino commented 7 months ago

Will figure out how it could happen.

zanhk commented 7 months ago

Seem like images on assets folder have the same problem

image

kyoshino commented 7 months ago

Just shipped the fix! It was certainly due to the cache thing. 🙇🏼

zanhk commented 7 months ago

Just shipped the fix! It was certainly due to the cache thing. 🙇🏼

Awesome!