astro-accelerator 6.0.13 → 6.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
package/public/css/main.css
CHANGED
package/public/js/search.js
CHANGED
|
@@ -60,6 +60,7 @@ function unique(value, index, array) {
|
|
|
60
60
|
tags: string[];
|
|
61
61
|
url: string;
|
|
62
62
|
date: string;
|
|
63
|
+
bannerImage: { src: string; alt: string } | null;
|
|
63
64
|
matchedHeadings: Heading[];
|
|
64
65
|
}
|
|
65
66
|
} SearchEntry
|
|
@@ -375,9 +376,22 @@ function initializeSearch() {
|
|
|
375
376
|
li.dataset.score = (
|
|
376
377
|
Math.round((needle.score / total) * 1000) / 1000
|
|
377
378
|
).toString();
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
379
|
+
const resultContent = document.createElement('div');
|
|
380
|
+
resultContent.className = 'result-content';
|
|
381
|
+
resultContent.appendChild(path);
|
|
382
|
+
resultContent.appendChild(listElementTitle);
|
|
383
|
+
resultContent.appendChild(listElementDescription);
|
|
384
|
+
|
|
385
|
+
if (needle.bannerImage) {
|
|
386
|
+
const resultImage = document.createElement('img');
|
|
387
|
+
resultImage.src = needle.bannerImage.src;
|
|
388
|
+
resultImage.alt = needle.bannerImage.alt;
|
|
389
|
+
resultImage.className = 'result-image';
|
|
390
|
+
resultImage.loading = 'lazy';
|
|
391
|
+
listElementWrapper.appendChild(resultImage);
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
listElementWrapper.appendChild(resultContent);
|
|
381
395
|
li.appendChild(listElementWrapper);
|
|
382
396
|
|
|
383
397
|
if (
|
package/src/pages/search.json.ts
CHANGED
|
@@ -117,7 +117,22 @@ const accelerator = new Accelerator(SITE);
|
|
|
117
117
|
|
|
118
118
|
.site-search-results-item a {
|
|
119
119
|
text-decoration: none;
|
|
120
|
-
display:
|
|
120
|
+
display: flex;
|
|
121
|
+
gap: 1.5rem;
|
|
122
|
+
align-items: flex-start;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.result-image {
|
|
126
|
+
width: 120px;
|
|
127
|
+
height: 120px;
|
|
128
|
+
object-fit: cover;
|
|
129
|
+
border-radius: var(--block-radius);
|
|
130
|
+
flex-shrink: 0;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.result-content {
|
|
134
|
+
flex: 1;
|
|
135
|
+
min-width: 0;
|
|
121
136
|
}
|
|
122
137
|
|
|
123
138
|
.site-search-results .show-more {
|
|
@@ -210,6 +225,17 @@ const accelerator = new Accelerator(SITE);
|
|
|
210
225
|
width: unset;
|
|
211
226
|
}
|
|
212
227
|
|
|
228
|
+
.result-wrapper {
|
|
229
|
+
flex-direction: column;
|
|
230
|
+
gap: 1rem;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
.result-image {
|
|
234
|
+
width: 100%;
|
|
235
|
+
height: auto;
|
|
236
|
+
max-height: 200px;
|
|
237
|
+
}
|
|
238
|
+
|
|
213
239
|
.site-search-wrapper button {
|
|
214
240
|
width: 100%;
|
|
215
241
|
}
|