Browse Source

chore: display page aliases

Tienson Qin 5 years ago
parent
commit
74402fce1d
1 changed files with 9 additions and 0 deletions
  1. 9 0
      src/main/frontend/components/page.cljs

+ 9 - 0
src/main/frontend/components/page.cljs

@@ -354,6 +354,15 @@
                                          :href (str "/file/" (util/url-encode file-path))}
                   file-path]])]
 
+             (when (and repo (not block?))
+               (let [alias (db/get-page-alias-names repo page-name)]
+                 (when (seq alias)
+                   [:div.text-sm.ml-1.mb-4 {:key "page-file"}
+                    [:span.opacity-50 "Alias: "]
+                    (for [item alias]
+                      [:a.ml-1.mr-1 {:href (str "/page/" (util/encode-str item))}
+                       item])])))
+
              (when (and block? (not sidebar?))
                [:div.mb-4
                 (block/block-parents repo block-id format)])