summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreltrac <hi@eltr.ac>2026-03-17 17:00:35 +0800
committereltrac <hi@eltr.ac>2026-03-17 17:00:35 +0800
commitcfdb7b7e2f2a26bc4d5f87cd3abe6f120b8cbe45 (patch)
treefe82c15c5c846a921c40f0347297d455b3481a02
parent5c618dd6176ce5d02dee043420f192417c910e3b (diff)
feat(ui): preset target in webmention sender form
-rw-r--r--src/weepinbell/handler.clj5
-rw-r--r--src/weepinbell/ui.clj5
2 files changed, 6 insertions, 4 deletions
diff --git a/src/weepinbell/handler.clj b/src/weepinbell/handler.clj
index 056c8f4..24d06d6 100644
--- a/src/weepinbell/handler.clj
+++ b/src/weepinbell/handler.clj
@@ -16,8 +16,9 @@
(process-webmention wmc)
(defroutes api-routes
- (GET "/" [] (ui/home (get-config :allowed-target-domains)
- (get-config :endpoint)))
+ (GET "/" [target] (ui/home (get-config :allowed-target-domains)
+ (get-config :endpoint)
+ target))
;; receiver endpoint
(POST (get-config :endpoint) [source target]
(receive {:s source :t target} wmc))
diff --git a/src/weepinbell/ui.clj b/src/weepinbell/ui.clj
index d68ef74..5d83063 100644
--- a/src/weepinbell/ui.clj
+++ b/src/weepinbell/ui.clj
@@ -14,7 +14,7 @@
[:title "Weepinbell - Webmention Receiver"]]
[:body slot]])))
-(defn home [domains endpoint]
+(defn home [domains endpoint preset-target]
(->
[:main.home
[:img.banner {:src "/weepinbell.avif"}]
@@ -25,7 +25,8 @@
[:p "Have him send a Webmention for you."]
[:form {:action endpoint :method "POST"}
[:input {:name "source" :placeholder "source"}]
- [:input {:name "target" :placeholder "target"}]
+ [:input {:name "target" :placeholder "target"
+ :value preset-target}]
[:button {:type "submit"} "send"]]]]
page-base
page-response))