commit e0d81ccb6f03b25e114415d777a148cb82464a2e
parent e1b54c0e06db04f8c6dc19888a234ef5d52e6de6
Author: Daniel Barlow <dan@telent.net>
Date: Mon, 31 Aug 2026 22:42:34 +0100
populate search form on result pages
Diffstat:
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/main.fnl b/main.fnl
@@ -163,7 +163,7 @@ img.floated { width: 40%%; float: right; clear: right; border: 1px #555 solid; b
topic]])
(table.insert 1 :div))]))
-(fn sidebar [stream collection]
+(fn sidebar [stream collection terms]
(let [s (stream-from-cq-stream stream)
topics (collection:weighted-topics)
ladder (all-months collection)]
@@ -182,7 +182,7 @@ href=\"https://axillae.telent.net/\">@dan@axillae.telent.net</a>
[:h2 "Search"]
[:p "Google has given up on me (it's mutual)"]
[[:form {:method :get :action "/search" }]
- [[:input {:name :terms :type :text}]]
+ [[:input {:name :terms :type :text :value (or terms "")}]]
[[:input {:name :go :value "Search" :type :submit}]]]]
s)
(to-html (topics-html topics) s)
@@ -320,7 +320,7 @@ href=\"https://axillae.telent.net/\">@dan@axillae.telent.net</a>
(os.date "%d %b %Y" p.date)
]))]
s)
- (sidebar stream collection)
+ (sidebar stream collection terms)
(page-footer stream)
(stream:write_chunk "" true)))