💾 Archived View for thurk.org › blog › 138.gmi captured on 2023-07-22 at 16:52:36. Gemini links have been rewritten to link to archived content
⬅️ Previous capture (2022-03-01)
-=-=-=-=-=-=-
Here is the code spouting the error:
(defpage "/expand/:id" {:keys [id]} (let [e (entry/get-record id)] (normal-entry e) (expand-contract-link "contract" e)))
As any observant mustelid can see, there is nothing wrong with that code according to the Noir documentation[1]. I shall pull out pieces of my pancreas for a few more minutes flummoxing myself about it.
I dislike it greatly when a problem solves itself, and especially if it is just from tinkering a bit.
Here is the code:
(defpartial expand-contract-link [which e] [:br.clear] (link-to {:id (str which (:id e))} "#" which) [:hr.clear]) (defpartial ajax-hovno [] [:script "ajax_hovno();"]) (defpartial normal-entry [e] (:entry e) (expand-contract-link "contract" e) (ajax-hovno)) (defpartial truncated-entry [e] (trunc (:entry e)) (expand-contract-link "expand" e) (ajax-hovno)) ; Ajax paths (defpage "/expand/:id" {:keys [id]} (normal-entry (entry/get-record id))) (defpage "/contract/:id" {:keys [id]} (truncated-entry (entry/get-record id)))
1: http://www.webnoir.org/tutorials/routes
@flavigula@sonomu.club
CC BY-NC-SA 4.0