imlinhanchao/vsc-markdown-image

githunCDN上传后文件名称如何设置

Closed this issue · 7 comments

https://cdn.jsdelivr.net/gh/ChenDaqian/Imgs@main/Files/${YY}-${MM}-${DD}-${HH}-${mm}
如上链接files后面的文件名称如何获取?直接写占位符上传后发现没有替换占位符

使用 diy 属性设置吗?

设置在markdown-image.base.fileNameFormat

好像已经可以了
"markdown-image.base.fileNameFormat": "${YY}-${MM}-${DD}-${HH}-${mm}",
"markdown-image.github.cdn": "https://cdn.jsdelivr.net/gh/ChenDaqian/Imgs@main/${filepath}",
是这样设置的

是的,没错。

看文档描述有点歧义,我以为cdn 的${} 都是占位符需要自己替换,没想到filepath会自动替换为 base.fileNameFormat

markdown-image.github.cdn标准应该设置成https://cdn.jsdelivr.net/gh/${username}/${repository}@${branch}/${filepath}

${filepath}下个版本我再备注一下吧。

感谢