Small improvement in js

pull/650/head
stereobooster 2023-09-12 12:06:54 +02:00
parent c22dbc06ee
commit fc4120662a
1 changed files with 13 additions and 15 deletions

View File

@ -133,21 +133,19 @@ function executeQuery(term) {
let resultsHTML = ""; let resultsHTML = "";
if (results.length > 0) { if (results.length > 0) {
results.forEach(function (value, key) { resultsHTML = results.forEach(function (value, key) {
resultsHTML = return `<li class="mb-2">
resultsHTML + <a class="flex items-center px-3 py-2 rounded-md appearance-none bg-neutral-100 dark:bg-neutral-700 focus:bg-primary-100 hover:bg-primary-100 dark:hover:bg-primary-900 dark:focus:bg-primary-900 focus:outline-dotted focus:outline-transparent focus:outline-2" href="${value.item.permalink}" tabindex="0">
`<li class="mb-2"> <div class="grow">
<a class="flex items-center px-3 py-2 rounded-md appearance-none bg-neutral-100 dark:bg-neutral-700 focus:bg-primary-100 hover:bg-primary-100 dark:hover:bg-primary-900 dark:focus:bg-primary-900 focus:outline-dotted focus:outline-transparent focus:outline-2" href="${value.item.permalink}" tabindex="0"> <div class="-mb-1 text-lg font-bold">${value.item.title}</div>
<div class="grow"> <div class="text-sm text-neutral-500 dark:text-neutral-400">${value.item.section}${value.item.date == null ? '' : `<span class="px-2 text-primary-500">&middot;</span>${value.item.date}</span>`}</div>
<div class="-mb-1 text-lg font-bold">${value.item.title}</div> <div class="text-sm italic">${value.item.summary}</div>
<div class="text-sm text-neutral-500 dark:text-neutral-400">${value.item.section}${value.item.date == null ? '' : `<span class="px-2 text-primary-500">&middot;</span>${value.item.date}</span>`}</div> </div>
<div class="text-sm italic">${value.item.summary}</div> <div class="ml-2 ltr:block rtl:hidden text-neutral-500">&rarr;</div>
</div> <div class="mr-2 ltr:hidden rtl:block text-neutral-500">&larr;</div>
<div class="ml-2 ltr:block rtl:hidden text-neutral-500">&rarr;</div> </a>
<div class="mr-2 ltr:hidden rtl:block text-neutral-500">&larr;</div> </li>`;
</a> }).join("");
</li>`;
});
hasResults = true; hasResults = true;
} else { } else {
resultsHTML = ""; resultsHTML = "";