🎨 搜索资源文件支持跟随 assets 文件夹符号链接 Fix https://github.com/siyuan-note/siyuan/issues/6217

This commit is contained in:
Liang Ding 2022-10-16 14:15:42 +08:00
parent a00e25cd1e
commit 56128b9cb7
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
3 changed files with 22 additions and 28 deletions

View file

@ -43,7 +43,7 @@ func LoadAssets() {
assetsLock.Lock()
defer assetsLock.Unlock()
assets := filepath.Join(util.DataDir, "assets")
assets := util.GetDataAssetsAbsPath()
filepath.Walk(assets, func(path string, info fs.FileInfo, err error) error {
if nil == info {
return err
@ -59,7 +59,7 @@ func LoadAssets() {
}
hName := util.RemoveID(info.Name())
path = filepath.ToSlash(strings.TrimPrefix(path, util.DataDir))[1:]
path = "assets" + filepath.ToSlash(strings.TrimPrefix(path, assets))
Assets[path] = &Asset{
HName: hName,
Path: path,