fix(fs): asset url of non-ex page

This commit is contained in:
Andelf
2023-03-16 18:30:38 +08:00
parent 97b534301b
commit ee41048053

View File

@@ -1516,13 +1516,14 @@
[file-path]
(if-let [current-file-rpath (or (db-model/get-block-file-path (state/get-edit-block))
;; fix dummy file path of page
(and (util/electron?)
(util/node-path.join
(config/get-repo-dir (state/get-current-repo))
(config/get-pages-directory) "_.md")))]
(and (util/electron?)
(util/node-path.join
(config/get-repo-dir (state/get-current-repo))
(config/get-pages-directory) "_.md"))
"pages/contents.md")]
(let [repo-dir (config/get-repo-dir (state/get-current-repo))
current-file-fpath (path/path-join repo-dir current-file-rpath)]
(util/get-relative-path current-file-fpath file-path))
current-file-fpath (path/path-join repo-dir current-file-rpath)]
(util/get-relative-path current-file-fpath file-path))
file-path))
(defn upload-asset