diff options
author | colin <colin@cicadas.surf> | 2023-09-23 08:42:05 -0700 |
---|---|---|
committer | colin <colin@cicadas.surf> | 2023-09-23 08:42:05 -0700 |
commit | ccbb164eec042cb37babb3bff8e240284c9eda50 (patch) | |
tree | f2444762d96f8d8d9fc51bc17cc337bb2b0e556a /fussy.lisp | |
parent | 630f4dd07c44bd4cdf475a63d60ef2a5efea1218 (diff) |
changed default theme sample display file to lisp
Diffstat (limited to 'fussy.lisp')
-rw-r--r-- | fussy.lisp | 24 |
1 files changed, 16 insertions, 8 deletions
@@ -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)))))))) |