mirror of
https://github.com/logseq/logseq.git
synced 2026-05-26 21:54:26 +00:00
improve(custom.css): support import current graph assets file
This commit is contained in:
@@ -373,6 +373,15 @@
|
||||
(get-file-path repo
|
||||
(str app-name "/" export-css-file)))))
|
||||
|
||||
(defn expand-relative-assets-path
|
||||
;; ../assets/xxx -> {assets|file}://{current-graph-root-path}/xxx
|
||||
[source]
|
||||
(when-let [protocol (and (string? source)
|
||||
(not (string/blank? source))
|
||||
(if (util/electron?) "assets" "file"))]
|
||||
|
||||
(string/replace
|
||||
source "../assets" (util/format "%s://%s/assets" protocol (get-repo-dir (state/get-current-repo))))))
|
||||
|
||||
(defn get-custom-js-path
|
||||
([]
|
||||
|
||||
@@ -125,7 +125,8 @@
|
||||
[]
|
||||
(when-let [style (or
|
||||
(state/get-custom-css-link)
|
||||
(db-model/get-custom-css)
|
||||
(some-> (db-model/get-custom-css)
|
||||
(config/expand-relative-assets-path))
|
||||
;; (state/get-custom-css-link)
|
||||
)]
|
||||
(util/add-style! style)))
|
||||
|
||||
Reference in New Issue
Block a user