You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
as you can see media_folder name is based on the filename. But the problem is that when you create post file doesn't exist, so images in markdown is written with wrong path.
As a side note, thank you for adding this. I didn't realize that media_folder and public_folder could be added as additional params within a collection. 🙌
That handles the location of image files in the repo.
However, we don't fix it in the markdown content, hence the issue.
We'll need to somehow update the content based on the fields configuration. I can't think of an issue way to do it (yet).
However a possible workaround is to use the preSave event to fix the markdown content.
Describe the bug
This is how I define my posts collection
as you can see media_folder name is based on the filename. But the problem is that when you create post file doesn't exist, so images in markdown is written with wrong path.
How to reproduce
Here is reproduction repository
https://github.com/smashercosmo/folder-collections-media-and-public-folder-issue
npm run develop
http://localhost:8000/admin/
new post
publish
Expected behavior
you should see correct image path in frontmatter
Actual behavior
you will see this instead
Applicable Versions:
The text was updated successfully, but these errors were encountered: