mirror of https://github.com/logseq/logseq
fix: indexing whiteboard page files
parent
4de59c6d63
commit
fb832d2493
|
@ -67,8 +67,9 @@
|
|||
files)
|
||||
support-files (sort-by :file/path support-files)
|
||||
{journals true non-journals false} (group-by (fn [file] (string/includes? (:file/path file) "journals/")) support-files)
|
||||
{whiteboards true non-whiteboards false} (group-by (fn [file] (string/includes? (:file/path file) "whiteboards/")) non-journals)
|
||||
{built-in true others false} (group-by (fn [file]
|
||||
(or (string/includes? (:file/path file) "contents.")
|
||||
(string/includes? (:file/path file) ".edn")
|
||||
(string/includes? (:file/path file) "custom.css"))) non-journals)]
|
||||
(concat (reverse journals) built-in others)))
|
||||
(string/includes? (:file/path file) "custom.css"))) non-whiteboards)]
|
||||
(concat (reverse journals) (reverse whiteboards) built-in others)))
|
||||
|
|
|
@ -15,11 +15,17 @@
|
|||
(gp-util/safe-re-find (re-pattern (str "^[./]*" local-assets-dir)) s))
|
||||
|
||||
(defonce default-draw-directory "draws")
|
||||
;; TODO read configurable value?
|
||||
(defonce default-whiteboards-directory "whiteboards")
|
||||
|
||||
(defn draw?
|
||||
[path]
|
||||
(string/starts-with? path default-draw-directory))
|
||||
|
||||
(defn whiteboard?
|
||||
[path]
|
||||
(string/includes? path (str "/" default-whiteboards-directory "/")))
|
||||
|
||||
;; TODO: rename
|
||||
(defonce mldoc-support-formats
|
||||
#{:org :markdown :md})
|
||||
|
|
|
@ -71,20 +71,24 @@
|
|||
(assoc
|
||||
(gp-block/page-name->map page false db true date-formatter)
|
||||
:block/file {:file/path (gp-util/path-normalize file)}))
|
||||
(seq properties)
|
||||
(assoc :block/properties properties)
|
||||
|
||||
(seq aliases)
|
||||
(assoc :block/alias aliases)
|
||||
(seq properties)
|
||||
(assoc :block/properties properties)
|
||||
|
||||
(:tags properties)
|
||||
(assoc :block/tags (let [tags (:tags properties)
|
||||
tags (if (string? tags) [tags] tags)
|
||||
tags (remove string/blank? tags)]
|
||||
(swap! ref-tags set/union (set tags))
|
||||
(map (fn [tag] {:block/name (gp-util/page-name-sanity-lc tag)
|
||||
:block/original-name tag})
|
||||
tags))))))
|
||||
(seq aliases)
|
||||
(assoc :block/alias aliases)
|
||||
|
||||
(gp-config/whiteboard? file)
|
||||
(assoc :block/whiteboard? true)
|
||||
|
||||
(:tags properties)
|
||||
(assoc :block/tags (let [tags (:tags properties)
|
||||
tags (if (string? tags) [tags] tags)
|
||||
tags (remove string/blank? tags)]
|
||||
(swap! ref-tags set/union (set tags))
|
||||
(map (fn [tag] {:block/name (gp-util/page-name-sanity-lc tag)
|
||||
:block/original-name tag})
|
||||
tags))))))
|
||||
|
||||
;; TODO: performance improvement
|
||||
(defn- extract-pages-and-blocks
|
||||
|
|
Loading…
Reference in New Issue