Skip to content

Commit

Permalink
use default thumb in search results
Browse files Browse the repository at this point in the history
  • Loading branch information
mnyrop committed Jul 19, 2023
1 parent 8f3c4fe commit 99bbd01
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions assets/search-ui.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
---
DEFAULT = "{{ site.default_thumb }}";

// Methods and jQuery UI for Wax search box
function excerptedString(str) {
str = str || ''; // handle null > string
Expand All @@ -10,11 +14,11 @@ function excerptedString(str) {
}

function getThumbnail(item, url) {
if ('thumbnail' in item) {
if (item.thumbnail) {
return `<img class='sq-thumb-sm' src='${url}${item.thumbnail}'/>&nbsp;&nbsp;&nbsp;`
}
else {
return '';
return `<img class='sq-thumb-sm' src='${url}${DEFAULT}'/>&nbsp;&nbsp;&nbsp;`
}
}

Expand Down

0 comments on commit 99bbd01

Please sign in to comment.