Using the FrontMatter UI for a field with type "image", the inserted path is relative to the project root instead of "frontMatter.content.publicFolder", making it so that direct use of the image URL by my website is not possible (for the running site, the URLs are relative to the public folder, not to the repo root).
This is something in between a bug (since the current behavior is surprising and has no workaround) and a feature request (since it might currently be working as intended).
To Reproduce
Steps to reproduce the behavior:
Add images to a static directory projects/site/static
Set "frontMatter.content.publicFolder" to projects/site/static
Add an image field to the default content-type, e.g.
In a Markdown file, open the Front Matter sidebar and scroll to the Image Path field
Click the image icon, browse for an image.
Hover over the vertical '...' and click the + icon to insert the path
Observe that the inserted path starts with projects/site/static
Expected behavior
I expect the "frontMatter.taxonomy.contentTypes" part of the path to be excluded from the inserted path, since all paths for the actual content are relative to the publicFolder root, not the repo root.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
OS: Windows 11 (Insiders)
Browser: Chrome (latest)
FrontMatter Version: latest of both release and beta extensions
**Describe the bug**
Using the FrontMatter UI for a field with type "image", the inserted path is relative to the project root instead of `"frontMatter.content.publicFolder"`, making it so that direct use of the image URL by my website is not possible (for the running site, the URLs are relative to the public folder, not to the repo root).
This is something in between a bug (since the current behavior is surprising and has no workaround) and a feature request (since it might currently be working as intended).
**To Reproduce**
Steps to reproduce the behavior:
1. Add images to a static directory `projects/site/static`
2. Set `"frontMatter.content.publicFolder"` to `projects/site/static`
3. Add an image field to the default content-type, e.g.
```json
{
"frontMatter.taxonomy.contentTypes": [
{
"name": "default",
"pageBundle": false,
"fileType": "md",
"fields": [
{
"title": "Image Path",
"name": "url",
"type": "image",
"isPreviewImage": true
}
]
}
]
}
```
4. In a Markdown file, open the Front Matter sidebar and scroll to the Image Path field
5. Click the image icon, browse for an image.
6. Hover over the vertical '...' and click the `+` icon to insert the path
7. Observe that the inserted path starts with `projects/site/static`
**Expected behavior**
I expect the "frontMatter.taxonomy.contentTypes" part of the path to be excluded from the inserted path, since all paths for the actual content are relative to the publicFolder root, not the repo root.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Desktop (please complete the following information):**
- OS: Windows 11 (Insiders)
- Browser: Chrome (latest)
- FrontMatter Version: latest of both release and beta extensions
<!-- github-sync-id:1268653553 -->
Hi @adam-coster, thank you for opening this issue. Paths inserted to the content should be relative to the publicFolder or page bundle.
Questions
In order for us to reproduce the issue, would you be able to share a bit more details?
I see you have a projects/site/static set for the public folder, where does the content live?
Is projects the root of your solution you are opening in VS Code?
Hi @adam-coster, thank you for opening this issue. Paths inserted to the content should be relative to the `publicFolder` or page bundle.
**Questions**
In order for us to reproduce the issue, would you be able to share a bit more details?
- I see you have a `projects/site/static` set for the public folder, where does the content live?
- Is `projects` the root of your solution you are opening in VS Code?
<!-- github-comment-id:1153549605 -->
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Describe the bug
Using the FrontMatter UI for a field with type "image", the inserted path is relative to the project root instead of
"frontMatter.content.publicFolder", making it so that direct use of the image URL by my website is not possible (for the running site, the URLs are relative to the public folder, not to the repo root).This is something in between a bug (since the current behavior is surprising and has no workaround) and a feature request (since it might currently be working as intended).
To Reproduce
Steps to reproduce the behavior:
projects/site/static"frontMatter.content.publicFolder"toprojects/site/static+icon to insert the pathprojects/site/staticExpected behavior
I expect the "frontMatter.taxonomy.contentTypes" part of the path to be excluded from the inserted path, since all paths for the actual content are relative to the publicFolder root, not the repo root.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Hi @adam-coster, thank you for opening this issue. Paths inserted to the content should be relative to the
publicFolderor page bundle.Questions
In order for us to reproduce the issue, would you be able to share a bit more details?
projects/site/staticset for the public folder, where does the content live?projectsthe root of your solution you are opening in VS Code?To try to reproduce the issue, I configured the site as follows:
folders
frontmatter.json
Image path
Found the issue. It had to do with some Windows file parsing. It should be fixed in the
v7.3.4.Rad, thanks for the quick fix!