summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcolin <colin@cicadas.surf>2023-07-18 07:04:35 -0700
committercolin <colin@cicadas.surf>2023-07-18 07:04:35 -0700
commit2229786ff3015f49547c421ad81a3106d64dc39d (patch)
tree8f7c2d066be652eb132c999e8ca623c2f531507e
parenta22af6c69b49d6dfe2c979c4e748344b518e922d (diff)
browse by package by default
-rw-r--r--fussy.lisp19
1 files changed, 13 insertions, 6 deletions
diff --git a/fussy.lisp b/fussy.lisp
index e4b83c2..d37890b 100644
--- a/fussy.lisp
+++ b/fussy.lisp
@@ -423,8 +423,8 @@ that they are not loaded during image gen.")
(html:with-html
(:nav
(:a :href "/" (:h1 "FUSSY"))
- (:a :href "/" (:h4 "Browse by theme"))
- (:a :href "/packages" (:h4 "Browse by theme package")))))
+ (:a :href "/themes" (:h4 "Browse by theme"))
+ (:a :href "/" (:h4 "Browse by theme package")))))
(defun page-nav (page page-count &optional terms)
"relative pagination nav to current page."
@@ -609,7 +609,7 @@ h1, h2, h3, h4 {
(* page +themes-per-page+)
(* (1+ page) +themes-per-page+)))
-(lzb:defendpoint* :get "/" ((page an-integer) (terms a-search-query)) ()
+(lzb:defendpoint* :get "/themes" ((page an-integer) (terms a-search-query)) ()
"The landing page"
(let* ((page
(or page 0))
@@ -631,7 +631,7 @@ h1, h2, h3, h4 {
(:div :class "main"
(nav)
(gallery-header (length all-themes) "themes")
- (search-form "/" terms)
+ (search-form "/themes" terms)
(when (< 1 page-count)
(page-nav page page-count terms))
(:div :class "container"
@@ -658,7 +658,14 @@ h1, h2, h3, h4 {
(:a :href "https://melpa.org" "MELPA.") (:br)
"Newest first."))))
-(lzb:defendpoint* :get "/packages" ((page an-integer) (terms a-search-query)) ()
+(defun redirect-to (location)
+ "Set the lazybones response header and response code for redirecting to LOCATION.
+This procedure will error if lazybones:*request* is not currently bound."
+ (setf (lzb:response-header :location) location
+ (lzb:response-code) "303"))
+
+
+(lzb:defendpoint* :get "/" ((page an-integer) (terms a-search-query)) ()
"Browse the packages"
(let* ((page
(or page 0))
@@ -683,7 +690,7 @@ h1, h2, h3, h4 {
(:div :class "main"
(nav)
(gallery-header (length all-packages) "theme packages")
- (search-form "/packages" terms)
+ (search-form "/" terms)
(when (< 1 page-count)
(page-nav page page-count terms))
(:div :class "container"