Browse Source

add thumbnail path for SVG file in build-thumbnail-path filter.

The file-type contains 'image' so the filter assumed it was a .png or .jpg and
the image wouldn't render when it was a .svg file. This additional check to the
filter makes sure the svg.png (stock image file) is used when a thumbnail is
used in a HTML template.
stable
Craig Oates 2 years ago
parent
commit
1bec6e8034
  1. 4
      src/view.lisp

4
src/view.lisp

@ -70,7 +70,9 @@
(format nil "~S" (if (= 1 value) "on" "off")))
(djula:def-filter :build-thumbnail-path (file)
(cond ((str:contains? "image" (files::file-type-of file) :ignore-case t)
(cond ((str:contains? "svg" (files::file-type-of file) :ignore-case t)
(format nil "/images/icons/svg.png"))
((str:contains? "image" (files::file-type-of file) :ignore-case t)
(format nil "/storage/thumb/media/~a" (files::slug-of file)))
((str:contains? "pdf" (files::file-type-of file) :ignore-case t)
(format nil "/images/icons/pdf.png"))

Loading…
Cancel
Save