From a16f30aac0caad40a78cd15e08cf9021a69197c0 Mon Sep 17 00:00:00 2001 From: nat Date: Mon, 12 May 2025 15:26:10 -0700 Subject: [PATCH] fix issue with url params --- srv/content/router.hy | 2 +- www/src/pages/html/view-thought.hy | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/srv/content/router.hy b/srv/content/router.hy index 8d6bd36..5cd180c 100644 --- a/srv/content/router.hy +++ b/srv/content/router.hy @@ -40,7 +40,7 @@ (return (dict :code 200 - :body (parse-html-file "./www/site/html/html/view-thought.html" #** (. request (get "route") (get "parameters"))))))) + :body (parse-html-file "./www/site/html/html/view-thought.html" #** (dfor [k v] (.items (. request (get "route") (get "parameters"))) k (quote-plus v))))))) (when (= path "/style.css") (when (!= method "GET") diff --git a/www/src/pages/html/view-thought.hy b/www/src/pages/html/view-thought.hy index 8bd2d90..da0fab4 100644 --- a/www/src/pages/html/view-thought.hy +++ b/www/src/pages/html/view-thought.hy @@ -9,7 +9,7 @@ (if-param-then-else param-name f"'{{{param-name}}}'" otherwise)) (defn get-thought-param-field [field] - #[f[ cat www/data/thought-registry | grep -P "\t{{thought}}\t" | awk -v FS=$'\t' '{{print ${(get (dict :tags "1" :file-name "2" :title "3" :date "4" :description "5") field)}}}' ]f]) + #[f[ cat www/data/thought-registry | grep -P '\t{{thought}}\t'| awk -v FS=$'\t' '{{print ${(get (dict :tags "1" :file-name "2" :title "3" :date "4" :description "5") field)}}}' ]f]) (defn subshell [#* lines] #[f[({(.join "; " lines)})]f])