cripslock

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

commit d883d20c3ca6adb1cb272985b10efe64c4cb1a46
parent 473d801f6005b6a733dc530c2e35cfc0c6c26507
Author: Daniel Barlow <dan@telent.net>
Date:   Tue, 29 Jul 2025 22:19:08 +0100

delete unused code

Diffstat:
Mmain.fnl | 36++++--------------------------------
1 file changed, 4 insertions(+), 32 deletions(-)

diff --git a/main.fnl b/main.fnl @@ -8,7 +8,7 @@ (local { : to-html } (require :html)) (local { : string-stream : prepend } (require :lib)) -(local { : view &as fennel } (require :fennel)) +(local { : view } (require :fennel)) (local post-index (site.for-pathname "data/blogs/telent.blog/posts/")) @@ -122,8 +122,6 @@ ] links)))) - - (fn sidebar [site stream] (let [s { :write #(stream:write_chunk $2) } ladder (all-months site)] @@ -143,19 +141,6 @@ in the Fediverse at <a href=\"https://axillae.telent.net/\">@dan@axillae.telent. (define-tests :sidebar (print (view (all-months post-index)))) -(local send-search-results #true) - -(fn subst-search-result [text] - (let [(ok? terms) ((fennel.parser text))] - (case terms - { : filter : format } - (let [results (post-index:search terms) - s (string-stream)] - (send-search-results s format results) - (s:to-string)) - _ - "search syntax error"))) - (fn translate-markdown [md] ;; lcmark/cmark doesn't have any extension points that allow us ;; to add actual new syntax so we're just going to postprocess @@ -165,8 +150,6 @@ in the Fediverse at <a href=\"https://axillae.telent.net/\">@dan@axillae.telent. slug (or title (. (post-index:get slug) :title))))] (-> md - (string.gsub "\n/(%b{})" - subst-search-result) (lcmark.convert "html" { :yaml_parser #($1) }) (string.gsub "%[%[([%w_-]+)|(.-)%]%]" subst-links) (string.gsub "%[%[([%w_-]+)%]%]" subst-links)))) @@ -190,20 +173,9 @@ in the Fediverse at <a href=\"https://axillae.telent.net/\">@dan@axillae.telent. (to-html [[:div {:class :continuelink}] [:div [[:a { :href post.url-path}] "... continue reading"]]] s)))))) -(set-forcibly! - send-search-results - (fn [stream format results] - (case format - :titles - (to-html - (prepend :ul - (icollect [_ p (ipairs results)] - [:li [[:a { :href p.url-path}] p.title]])) - stream - ) - _ - (each [_ p (ipairs results)] - (send-post p stream (= format :excerpts)))))) +(fn send-search-results [stream format results] + (each [_ p (ipairs results)] + (send-post p stream (= format :excerpts)))) (fn send-home-page [stream] (server.headers stream { })