mirror of https://github.com/logseq/logseq
fix: namespace whiteboard pages import
parent
d647cd7107
commit
70406332dc
|
@ -294,9 +294,10 @@
|
|||
{:block/name page-name
|
||||
:block/original-name original-page-name}
|
||||
(when with-id?
|
||||
(let [new-uuid (cond page-entity (:block/uuid page-entity)
|
||||
(uuid? with-id?) with-id?
|
||||
:else (d/squuid))]
|
||||
(let [new-uuid (or
|
||||
(cond page-entity (:block/uuid page-entity)
|
||||
(uuid? with-id?) with-id?)
|
||||
(d/squuid))]
|
||||
{:block/uuid new-uuid}))
|
||||
(when namespace?
|
||||
(let [namespace (first (gp-util/split-last "/" original-page-name))]
|
||||
|
|
|
@ -116,13 +116,15 @@
|
|||
(defn split-namespace-pages
|
||||
[title]
|
||||
(let [parts (string/split title "/")]
|
||||
(->>
|
||||
(loop [others (rest parts)
|
||||
result [(first parts)]]
|
||||
(if (seq others)
|
||||
(let [prev (last result)]
|
||||
(recur (rest others)
|
||||
(conj result (str prev "/" (first others)))))
|
||||
result))))
|
||||
result))
|
||||
(map string/trim))))
|
||||
|
||||
(defn decode-namespace-underlines
|
||||
"Decode namespace underlines to slashed;
|
||||
|
|
|
@ -122,7 +122,8 @@
|
|||
:properties - map
|
||||
"
|
||||
[{:keys [type uuid title children properties] :as tree}]
|
||||
(let [has-children? (seq children)
|
||||
(let [title (string/trim title)
|
||||
has-children? (seq children)
|
||||
page-format (or (some-> tree (:children) (first) (:format)) :markdown)
|
||||
whiteboard? (= type "whiteboard")]
|
||||
(try (page-handler/create! title {:redirect? false
|
||||
|
|
Loading…
Reference in New Issue