mirror of
https://github.com/logseq/logseq.git
synced 2026-04-29 16:36:27 +00:00
feat: search
This commit is contained in:
@@ -272,7 +272,7 @@
|
||||
(recur e-cut new-result)
|
||||
new-result)))]))
|
||||
|
||||
(defn- page-item
|
||||
(defn page-item
|
||||
[repo page]
|
||||
(let [entity (db/entity [:block/uuid (:block/uuid page)])
|
||||
source-page (model/get-alias-source-page repo (:db/id entity))
|
||||
@@ -284,14 +284,14 @@
|
||||
:text title'
|
||||
:source-page (or source-page page))))
|
||||
|
||||
(defn- block-item
|
||||
[repo block current-page !input]
|
||||
(defn block-item
|
||||
[repo block current-page input]
|
||||
(let [id (:block/uuid block)
|
||||
text (block-handler/block-unique-title block)
|
||||
icon "letter-n"]
|
||||
{:icon icon
|
||||
:icon-theme :gray
|
||||
:text (highlight-content-query text @!input)
|
||||
:text (highlight-content-query text input)
|
||||
:header (when-not (db/page? block) (block/breadcrumb {:search? true} repo id {}))
|
||||
:current-page? (when-let [page-id (:block/page block)]
|
||||
(= page-id (:block/uuid current-page)))
|
||||
@@ -314,7 +314,7 @@
|
||||
items (keep (fn [block]
|
||||
(if (:page? block)
|
||||
(page-item repo block)
|
||||
(block-item repo block current-page !input))) blocks)]
|
||||
(block-item repo block current-page @!input))) blocks)]
|
||||
(if (= group :current-page)
|
||||
(let [items-on-current-page (filter :current-page? items)]
|
||||
(swap! !results update group merge {:status :success :items items-on-current-page}))
|
||||
|
||||
Reference in New Issue
Block a user