commit 376d35fc070195c359836ef7f65e7c877e87bd76 parent 78a4aad05a5a73d4f9630916230f1f77bf0b1e9f Author: Daniel Barlow <dan@telent.net> Date: Sat, 9 Aug 2025 15:40:04 +0100 show the post's topics at top of post Diffstat:
| M | site.fnl | | | 15 | ++++++++++++--- |
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/site.fnl b/site.fnl @@ -8,7 +8,7 @@ (local textile (require :textile)) (local lcmark (require :lcmark)) (local { : to-html } (require :html)) -(local { : parse-timestamp : trace : %% } (require :lib)) +(local { : prepend : parse-timestamp : trace : %% } (require :lib)) (fn markup-bare-urls [str] @@ -73,8 +73,17 @@ post.slug post.path post.title post.url-path - (os.date "%c" post.date) - ))) + (os.date "%c" post.date))) + (to-html + [:div + "Topics: " + (prepend + :span + (icollect [_ topic (pairs post.topics)] + [[:span {:class "topic"}] + " " + [[:a { :href (.. "/topic/" topic) }] topic]]))] + stream)) (fn post-body [post site stream excerpt?] (let [path post.full-path]