Просмотр исходного кода

enhance: published page shows tags prefixed

with '#' like in app. Affects block and page tags
Gabriel Horner 6 дней назад
Родитель
Сommit
7554e4e3f9
1 измененных файлов с 5 добавлено и 4 удалено
  1. 5 4
      deps/publish/src/logseq/publish/render.cljs

+ 5 - 4
deps/publish/src/logseq/publish/render.cljs

@@ -259,14 +259,15 @@
   (or (get name->uuid name)
       (get name->uuid (common-util/page-name-sanity-lc name))))
 
-(defn entity->link-node
-  [entity ctx]
+(defn- entity->link-node
+  [entity ctx prop-key]
   (let [title (publish-model/entity->title entity)
         uuid (:block/uuid entity)
         graph-uuid (:graph-uuid ctx)]
     (cond
       (and uuid graph-uuid (publish-model/page-entity? entity))
-      [[:a.page-ref {:href (str "/page/" graph-uuid "/" uuid)} title]]
+      [[:a.page-ref {:href (str "/page/" graph-uuid "/" uuid)}
+        (str (when (= prop-key :block/tags) "#") title)]]
       (common-util/url? title)
       [[:a {:href title} title]]
       :else
@@ -313,7 +314,7 @@
         (and ref-type? (get entities value))
         (let [entity (get entities value)]
           (with-icon (:logseq.property/icon entity)
-            (entity->link-node entity ctx)))
+            (entity->link-node entity ctx prop-key)))
 
         :else
         [(str value)])