This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-12-28
Channels
- # beginners (2)
- # calva (8)
- # capetown (1)
- # clojure (28)
- # clojure-europe (6)
- # clojure-norway (82)
- # clojure-sweden (1)
- # clojuredesign-podcast (5)
- # clojurescript (26)
- # core-async (3)
- # cryogen (7)
- # datahike (30)
- # datomic (10)
- # figwheel-main (8)
- # honeysql (8)
- # hyperfiddle (15)
- # jobs-discuss (6)
- # lsp (6)
- # matrix (6)
- # off-topic (12)
- # overtone (1)
- # polylith (6)
- # portal (6)
- # releases (1)
- # shadow-cljs (9)
- # sql (1)
- # xtdb (5)
FYI: I have added the https://github.com/holyjak/blog.jakubholy.net/commit/31be1330f1ae8d103a9955e59064d0b86230a632#diff-806f65b3b5cdd4c8dde7303249f0c0a38076165c5a5d1302b7fa5529b862f3fbR50-R81 to my blog, by leveraging :extend-params-fn
to compute <uri> -> related posts
and using this in post-content.html
to show these at the bottom of each post (the Related: under https://blog.jakubholy.net/2021/simplicity/#_summary).
On this topic, dear @yogthos: given the limitations of extensibility (`:extend-params-fn` cannot change the posts), I create the lookup uri -> other posts. A complication is that Selmer doesn’t allow me to do a lookup. What I want is st. like (when-let [related (get uri->related-posts (:uri post)) ...)
but the only tools I can find is for
to loop over all these entries + ifequal
to get data for the current post, if any. Is there a better way to do this? 🙏 (https://github.com/holyjak/blog.jakubholy.net/commit/31be1330f1ae8d103a9955e59064d0b86230a632#diff-2774a53d881a615fd5c9dc2df1e4e67f00322922c3c3366f40990e9453da511aR26-R35)
I think that might be the best option at the moment, but I'd be open to add a new selmer tag, or update for
to allow filtering
@U0522TWDA At work, we add the following:
(filters/add-filter! :get (fn [m k] (get m k)))
and we also rely on the @
format to dereference vars, so {{uri->related-posts|get:@post.uri}}
would work.(I actually had to go check the Selmer page to see if that filter was built-in because we use it so much at work @yogthos 🙂 )
Nice trick, thanks a lot!
On this topic, dear @yogthos: given the limitations of extensibility (`:extend-params-fn` cannot change the posts), I create the lookup uri -> other posts. A complication is that Selmer doesn’t allow me to do a lookup. What I want is st. like (when-let [related (get uri->related-posts (:uri post)) ...)
but the only tools I can find is for
to loop over all these entries + ifequal
to get data for the current post, if any. Is there a better way to do this? 🙏 (https://github.com/holyjak/blog.jakubholy.net/commit/31be1330f1ae8d103a9955e59064d0b86230a632#diff-2774a53d881a615fd5c9dc2df1e4e67f00322922c3c3366f40990e9453da511aR26-R35)