summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcolin <colin@cicadas.surf>2023-09-23 08:42:05 -0700
committercolin <colin@cicadas.surf>2023-09-23 08:42:05 -0700
commitccbb164eec042cb37babb3bff8e240284c9eda50 (patch)
treef2444762d96f8d8d9fc51bc17cc337bb2b0e556a
parent630f4dd07c44bd4cdf475a63d60ef2a5efea1218 (diff)
changed default theme sample display file to lisp
-rw-r--r--fussy.lisp24
1 files changed, 16 insertions, 8 deletions
diff --git a/fussy.lisp b/fussy.lisp
index 122d9b9..94fc532 100644
--- a/fussy.lisp
+++ b/fussy.lisp
@@ -354,12 +354,20 @@ that they are not loaded during image gen.")
(string-downcase (theme-pkg-name (theme-package theme)))
theme)))
-(defun theme-preview-image-path (theme &optional variant)
+(defun theme-preview-image-path (theme &optional (variant "lisp"))
(assert (theme-p theme))
- (format nil "/images/~a/~a/~a.svg"
- (string-downcase (theme-pkg-name (theme-package theme)))
- theme
- (or variant (pathname-name (first (image-files-for-theme theme))))))
+ (let* ((image-files
+ (image-files-for-theme theme))
+ (file
+ (or (find variant image-files
+ :key (a:compose #'pathname-type #'pathname-name)
+ :test #'string-equal)
+ (first image-files))))
+
+ (format nil "/images/~a/~a/~a.svg"
+ (string-downcase (theme-pkg-name (theme-package theme)))
+ theme
+ (pathname-name file))))
(defun the-update-time ()
(multiple-value-bind (sec min hour date month year) (get-decoded-time)
@@ -449,7 +457,7 @@ that they are not loaded during image gen.")
(:a :href (format-string pg) (format nil "~a" (1+ pg)))
" ")))))))
-(defun theme-preview-image (theme &optional variant)
+(defun theme-preview-image (theme &optional (variant "lisp"))
(html:with-html
(:img
:src (theme-preview-image-path theme variant))))
@@ -458,7 +466,7 @@ that they are not loaded during image gen.")
(html:with-html
(:div :class "card"
(:a :href (url-path theme) (:h4 theme)
- (theme-preview-image theme)))))
+ (theme-preview-image theme "lisp")))))
(defun package-preview-card (pkg)
(let ((themes (themes-in-package pkg)))
@@ -784,5 +792,5 @@ This procedure will error if lazybones:*request* is not currently bound."
(:p "A theme in the package "
(:a :href (url-path pkg) (package-namestring pkg))))
(:div :class "container"
- (dolist (variant (mapcar #'pathname-name (image-files-for-theme theme)))
+ (dolist (variant '("lisp" "py" "cpp"))
(theme-preview-image theme variant))))))))