Skip to content

Commit

Permalink
Allow to disable link hrefs (but keep for expanded-at lookup)
Browse files Browse the repository at this point in the history
  • Loading branch information
zampino committed Nov 27, 2023
1 parent 9e064e6 commit ebf7acd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/nextjournal/clerk/render/navbar.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
(into
[:div]
(map-indexed
(fn [i {:as item :keys [css-class emoji path title items]}]
(fn [i {:as item :keys [href css-class emoji path title items]}]
(let [label (or title (str/capitalize (last (str/split path #"/"))))
expanded? (get-in @!expanded-at [:toc path])
{:keys [expandable-toc?]} (merge render-opts item)]
Expand All @@ -71,7 +71,7 @@
:class (if expanded? "rotate-90" "rotate-0")}
[:path {:stroke-linecap "round" :stroke-linejoin "round" :d "M8.25 4.5l7.5 7.5-7.5 7.5"}]]])
[:a.py-1.flex.flex-auto.gap-1.group-hover:text-indigo-700.dark:group-hover:text-white.hover:underline.decoration-indigo-300.dark:decoration-slate-400.underline-offset-2
{:href path
{:href (if (some? href) href path)
:class (when (and expandable-toc? expanded?) "font-medium")
:on-click (fn [event]
(navigate-or-scroll! event item render-opts)
Expand All @@ -85,7 +85,7 @@
{:class "top-[25px] left-[10px]"}])]
[:a.flex.flex-auto.gap-1.py-1.rounded.hover:bg-slate-200.dark:hover:bg-slate-900.hover:text-indigo-700.dark:hover:text-white.hover:underline.decoration-indigo-300.dark:decoration-slate-400.underline-offset-2.transition
{:class "px-[6px] ml-[8px] mr-[4px]"
:href path
:href (if (some? href) href path)
:on-click (fn [event]
(navigate-or-scroll! event item render-opts)
(when mobile-toc?
Expand Down

0 comments on commit ebf7acd

Please sign in to comment.