diff --git a/deps/publish/src/logseq/publish/publish.css b/deps/publish/src/logseq/publish/publish.css index 95dd27adab..00d7e9e07c 100644 --- a/deps/publish/src/logseq/publish/publish.css +++ b/deps/publish/src/logseq/publish/publish.css @@ -81,7 +81,8 @@ body { h1 { font-size: clamp(30px, 3.4vw, 44px); - margin: 16px 0 28px; + margin-top: 1.5em; + margin-bottom: 0.25em; font-weight: 600; letter-spacing: 0.01em; } @@ -642,12 +643,23 @@ a:hover { .page-updated-at { color: var(--muted); - font-size: 12px; white-space: nowrap; - margin-bottom: 1rem; margin-left: 2px; } +.page-authors { + color: var(--muted); + white-space: nowrap; + margin-left: 2px; +} + +.page-meta { + display: flex; + margin-bottom: 2rem; + gap: 8px; + font-size: 13px; +} + @media (max-width: 720px) { .wrap { margin: 16px; @@ -682,6 +694,7 @@ a:hover { } .page-updated-at, + .page-authors, .tagged-meta { white-space: normal; } diff --git a/deps/publish/src/logseq/publish/render.cljs b/deps/publish/src/logseq/publish/render.cljs index a6aceb1825..acb28dbcdd 100644 --- a/deps/publish/src/logseq/publish/render.cljs +++ b/deps/publish/src/logseq/publish/render.cljs @@ -1040,6 +1040,22 @@ (str "Block: " source-block-uuid))]] [:span.tagged-meta (or (format-timestamp updated-at) "—")]])) +(defn- author-usernames + [entities page-eid page-entity] + (let [author-ids (->> entities + (keep (fn [[_e entity]] + (when (= (:block/page entity) page-eid) + (publish-model/ref-eid (:logseq.property/created-by-ref entity))))) + (concat [(publish-model/ref-eid (:logseq.property/created-by-ref page-entity))]) + (remove nil?) + distinct)] + (->> author-ids + (map #(get entities %)) + (keep publish-model/entity->title) + (remove string/blank?) + distinct + sort))) + (defn render-page-html [transit page-uuid-str refs-data tagged-nodes] (let [payload (publish-common/read-transit-safe transit) @@ -1062,6 +1078,7 @@ (when (= (:block/uuid entity) page-uuid) e)) entities) + authors (author-usernames entities page-eid page-entity) uuid->title (reduce (fn [acc [_e entity]] (if-let [uuid-value (:block/uuid entity)] (assoc acc (str uuid-value) (publish-model/entity->title entity)) @@ -1177,8 +1194,12 @@ (theme-toggle-node)) (page-title-node page-title (:logseq.property/icon page-entity)) - (let [updated-at (format-timestamp page-updated-at)] - [:div.page-updated-at updated-at]) + [:div.page-meta + (when true + [:div.page-authors (str "By: " (string/join ", " authors))]) + + (let [updated-at (format-timestamp page-updated-at)] + [:div.page-updated-at updated-at])] (when page-properties [:section.page-properties