registerCardImage(async(filePath,metadata)=>{return`<span>Your HTML for the card image</span>`;});
The metadata object is not well documented, but investigating, I could find the metadata.fmRelFilePath property inside it, wich value is the relative path of the document, and wich I used to define the path of the image
On linux, all worked ok.
But on windows, this property contains an absolute path, including drive letter. I don't know if it matters, but for my work on windows, project was on d:\ drive, not c:\
Workaround
As a workaround, I used the metadata.fmRelFileWsPath property, wich contains a relative path, once stripped the [[workspace]] part at the beginning of its value. This works on linux and windows.
Expected behavior metadata.fmRelFilePath should be a relative path, may it be on windows or on linux.
Device:
OS: windows
Front Matter CMS Version [10.7.0]
**Describe the bug**
`metadata`.`fmRelFilePath` is not a relative path on windows
**To Reproduce**
I followed the guide here: https://frontmatter.codes/docs/ui-extensibility#registering-a-card-image
It has this bit of code:
```js
registerCardImage(async (filePath, metadata) => {
return `<span>Your HTML for the card image</span>`;
});
```
The `metadata` object is not well documented, but investigating, I could find the `metadata`.`fmRelFilePath` property inside it, wich value is the relative path of the document, and wich I used to define the path of the image
On linux, all worked ok.
But on windows, this property contains an absolute path, including drive letter. I don't know if it matters, but for my work on windows, project was on `d:\` drive, not `c:\`
**Workaround**
As a workaround, I used the `metadata`.`fmRelFileWsPath` property, wich contains a relative path, once stripped the `[[workspace]]` part at the beginning of its value. This works on linux and windows.
**Expected behavior**
`metadata`.`fmRelFilePath` should be a relative path, may it be on windows or on linux.
**Device:**
- OS: windows
- Front Matter CMS Version [10.7.0]
<!-- github-sync-id:2852341238 -->
Thanks! I implemented a fix earlier this week for the parsing of Windows paths. It seems that in the latest version of VSCode, there has been a change in how Windows paths are returned. In some cases, it provides a drive letter as uppercase and lowercase in other cases. I believe this is what is causing the issue here as well.
Could you give the latest beta version a try to see if that version already fixes the issue?
Thanks! I implemented a fix earlier this week for the parsing of Windows paths. It seems that in the latest version of VSCode, there has been a change in how Windows paths are returned. In some cases, it provides a drive letter as uppercase and lowercase in other cases. I believe this is what is causing the issue here as well.
Could you give the latest beta version a try to see if that version already fixes the issue?
https://marketplace.visualstudio.com/items?itemName=eliostruyf.vscode-front-matter-beta
<!-- github-comment-id:2658591583 -->
Hi ! Thank your for your answer, and sorry for the delay of my answer, I do not access widows machines verty often. It turns out that the bug it still here on latest version 10.8.0
FmRelFilePath still contains the full path with drive letter (d:/ on my case), not the relative path. I think this issue should be reopened
Hi ! Thank your for your answer, and sorry for the delay of my answer, I do not access widows machines verty often. It turns out that the bug it still here on latest version 10.8.0
FmRelFilePath still contains the full path with drive letter (d:/ on my case), not the relative path. I think this issue should be reopened
<!-- github-comment-id:2726934302 -->
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
metadata.fmRelFilePathis not a relative path on windowsTo Reproduce
I followed the guide here: https://frontmatter.codes/docs/ui-extensibility#registering-a-card-image
It has this bit of code:
The
metadataobject is not well documented, but investigating, I could find themetadata.fmRelFilePathproperty inside it, wich value is the relative path of the document, and wich I used to define the path of the imageOn linux, all worked ok.
But on windows, this property contains an absolute path, including drive letter. I don't know if it matters, but for my work on windows, project was on
d:\drive, notc:\Workaround
As a workaround, I used the
metadata.fmRelFileWsPathproperty, wich contains a relative path, once stripped the[[workspace]]part at the beginning of its value. This works on linux and windows.Expected behavior
metadata.fmRelFilePathshould be a relative path, may it be on windows or on linux.Device:
Thanks! I implemented a fix earlier this week for the parsing of Windows paths. It seems that in the latest version of VSCode, there has been a change in how Windows paths are returned. In some cases, it provides a drive letter as uppercase and lowercase in other cases. I believe this is what is causing the issue here as well.
Could you give the latest beta version a try to see if that version already fixes the issue?
https://marketplace.visualstudio.com/items?itemName=eliostruyf.vscode-front-matter-beta
Hi ! Thank your for your answer, and sorry for the delay of my answer, I do not access widows machines verty often. It turns out that the bug it still here on latest version 10.8.0
FmRelFilePath still contains the full path with drive letter (d:/ on my case), not the relative path. I think this issue should be reopened