浏览代码

enhance: rename Contents to Favorites

Tienson Qin 4 年之前
父节点
当前提交
c0760eb585

+ 1 - 1
src/main/frontend/components/page.cljs

@@ -310,7 +310,7 @@
                  (let [contents? (= (string/lower-case (str page-name)) "contents")
                        links (fn [] (->>
                                     [(when-not contents?
-                                       {:title   (t :page/add-to-contents)
+                                       {:title   (t :page/add-to-favorites)
                                         :options {:on-click (fn [] (page-handler/handle-add-page-to-contents! page-original-name))}})
 
                                      {:title "Go to presentation mode"

+ 4 - 2
src/main/frontend/components/right_sidebar.cljs

@@ -95,7 +95,8 @@
   [repo idx db-id block-type block-data t]
   (case block-type
     :contents
-    [(t :right-side-bar/contents)
+    [(or (state/get-favorites-name)
+         (t :right-side-bar/favorites))
      (contents)]
 
     :recent
@@ -267,7 +268,8 @@
             [:div.ml-4.text-sm
              [:a.cp__right-sidebar-settings-btn {:on-click (fn [e]
                                                              (state/sidebar-add-block! repo "contents" :contents nil))}
-              (t :right-side-bar/contents)]]
+              (or (state/get-favorites-name)
+                  (t :right-side-bar/favorites))]]
 
             [:div.ml-4.text-sm
              [:a.cp__right-sidebar-settings-btn {:on-click (fn [_e]

+ 4 - 6
src/main/frontend/dicts.cljs

@@ -97,6 +97,7 @@
         :right-side-bar/page "Page graph"
         :right-side-bar/recent "Recent"
         :right-side-bar/contents "Contents"
+        :right-side-bar/favorites "Favorites"
         :right-side-bar/page-graph "Page graph"
         :right-side-bar/block-ref "Block reference"
         :git/set-access-token "Set Github personal access token"
@@ -152,7 +153,7 @@
         :page/cancel-publishing "Cancel publishing on Logseq"
         :page/publish-as-slide "Publish this page as a slide on Logseq"
         :page/unpublish "Un-publish this page on Logseq"
-        :page/add-to-contents "Add to Contents"
+        :page/add-to-favorites "Add to Favorites"
         :page/show-journals "Show Journals"
         :page/show-name "Show page name"
         :page/hide-name "Hide page name"
@@ -379,7 +380,6 @@
         :page/cancel-publishing "Veröffentlichung auf Logseq abbrechen"
         :page/publish-as-slide "Diese Seite als Folie auf Logseq veröffentlichen"
         :page/unpublish "Veröffentlichung dieser Seite auf Logseq rückgängig machen"
-        :page/add-to-contents "Zum Inhaltsverzeichnis hinzufügen"
         :page/show-journals "Journal anzeigen"
         :page/show-name "Seitennamen anzeigen"
         :page/hide-name "Seitennamen verbergen"
@@ -577,7 +577,6 @@
         :page/cancel-publishing "Cancel publishing on Logseq"
         :page/publish-as-slide "Publier cette page en présentation sur Logseq"
         :page/unpublish "Dépublier cette page de Logseq"
-        :page/add-to-contents "Ajouter au Contenu"
         :page/show-journals "Afficher le Journal"
         :page/show-name "Afficher le nom de la page"
         :page/hide-name "Cacher le nom de la page"
@@ -764,6 +763,7 @@
            :right-side-bar/page "页面图谱"
            :right-side-bar/recent "最近"
            :right-side-bar/contents "目录"
+           :right-side-bar/favorites "收藏"
            :right-side-bar/page-graph "页面图谱:"
            :right-side-bar/block-ref "块引用"
            :git/set-access-token "设定 Github 个人访问令牌"
@@ -819,7 +819,7 @@
            :page/cancel-publishing "撤回本页在 Logseq 上的发布"
            :page/publish-as-slide "将本页作为幻灯片发布至 Logseq"
            :page/unpublish "取消将本页发布至 Logseq"
-           :page/add-to-contents "将本页添加到目录"
+           :page/add-to-favorites "添加收藏"
            :page/show-journals "显示日志"
            :page/show-name "显示页面名"
            :page/hide-name "隐藏页面名"
@@ -1070,7 +1070,6 @@
              :page/cancel-publishing "Cancel publishing on Logseq"
              :page/publish-as-slide "將本頁作為幻燈片發布至 Logseq"
              :page/unpublish "取消將本頁發布至 Logseq"
-             :page/add-to-contents "將本頁添加到目錄"
              :page/show-journals "顯示日志"
              :page/show-name "顯示頁面名"
              :page/hide-name "隱藏頁面名"
@@ -1297,7 +1296,6 @@
         :page/cancel-publishing "Cancel publishing on Logseq"
         :page/publish-as-slide "Publiseer hierdie blad as 'n skyfie op Logseq"
         :page/unpublish "Verwyder blad publikasie op Logseq"
-        :page/add-to-contents "Voeg by inhoud"
         :page/show-journals "Wys joernale"
         :page/show-name "Wys blad naam"
         :page/hide-name "Steek bladnaam weg"

+ 4 - 0
src/main/frontend/state.cljs

@@ -1309,3 +1309,7 @@
    (clear-edit!)
    (set-selection-blocks! blocks direction)
    (util/select-highlight! blocks)))
+
+(defn get-favorites-name
+  []
+  (:name/favorites (get-config)))

+ 1 - 5
templates/contents.md

@@ -1,5 +1 @@
-- What's **Contents**?
-    - It's a normal page called [[Contents]], you can use it for:
-    - 1. table of content/index/MOC
-    - 2. pinning/bookmarking favorites pages/blocks (e.g. [[Logseq]])
-    - 3. You can also put many different things, depending on your personal workflow.
+-

+ 1 - 5
templates/contents.org

@@ -1,5 +1 @@
-* What's **Contents**?
-** It's a normal page called [[Contents]], you can use it for:
-*** 1. table of content/index/MOC
-*** 2. pinning/bookmarking favorites pages/blocks (e.g. [[Logseq]])
-*** 3. You can also put many different things, depending on your personal workflow.
+*