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
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]
The text was updated successfully, but these errors were encountered:
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?
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
Describe the bug
metadata
.fmRelFilePath
is 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
metadata
object is not well documented, but investigating, I could find themetadata
.fmRelFilePath
property 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
.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:
The text was updated successfully, but these errors were encountered: