File tree 2 files changed +5
-9
lines changed
2 files changed +5
-9
lines changed Original file line number Diff line number Diff line change 35
35
36
36
(defn toc-items [items]
37
37
(reduce
38
- (fn [acc {:as item :keys [content children attrs]}]
38
+ (fn [acc {:as item :keys [content children attrs emoji ]}]
39
39
(if content
40
40
(let [title (md.transform/->text item)]
41
41
(->> {:title title
42
+ :emoji emoji
42
43
:path (str " #" (:id attrs))
43
44
:items (toc-items children)}
44
45
(conj acc)
Original file line number Diff line number Diff line change 1
1
(ns nextjournal.clerk.render.navbar
2
- (:require [" emoji-regex" :as emoji-regex]
3
- [" framer-motion" :as framer-motion :refer [motion AnimatePresence]]
2
+ (:require [" framer-motion" :as framer-motion :refer [motion AnimatePresence]]
4
3
[nextjournal.clerk.render.localstorage :as localstorage]
5
4
[applied-science.js-interop :as j]
6
5
[clojure.string :as str]
7
6
[reagent.core :as r]))
8
7
9
- (def emoji-re (emoji-regex ))
10
-
11
8
(defn stop-event! [event]
12
9
(.preventDefault event)
13
10
(.stopPropagation event))
74
71
(into
75
72
[:div ]
76
73
(map-indexed
77
- (fn [i {:keys [path title expanded? loading? items toc]}]
78
- (let [label (or title (str/capitalize (last (str/split path #"/" ))))
79
- emoji (when (zero? (.search label emoji-re))
80
- (first (.match label emoji-re)))]
74
+ (fn [i {:keys [emoji path title expanded? loading? items toc]}]
75
+ (let [label (or title (str/capitalize (last (str/split path #"/" ))))]
81
76
[:<>
82
77
(if (seq items)
83
78
[:div.flex.cursor-pointer
You can’t perform that action at this time.
0 commit comments